Skip to content

Commit

Permalink
replace deprecated method in StringUtils isEmpty with hasLength
Browse files Browse the repository at this point in the history
  • Loading branch information
Parisa68 committed Jan 3, 2024
1 parent ce7ede5 commit b61acef
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private InputStream getPlaintextResponse(byte[] header, InputStream bodyInputStr
ByteArrayInputStream headerInputStream = new ByteArrayInputStream(header);
SequenceInputStream sequenceInputStream = new SequenceInputStream(headerInputStream, bodyInputStream);
Crypt4GHInputStream crypt4GHInputStream;
if (!StringUtils.isEmpty(startCoordinate) && !StringUtils.isEmpty(endCoordinate)) {
if (StringUtils.hasLength(startCoordinate) && StringUtils.hasLength(endCoordinate)) {
DataEditList dataEditList = new DataEditList(new long[]{Long.parseLong(startCoordinate), Long.parseLong(endCoordinate)});
crypt4GHInputStream = new Crypt4GHInputStream(sequenceInputStream, dataEditList, privateKey);
} else {
Expand All @@ -109,7 +109,7 @@ private InputStream getPlaintextResponse(byte[] header, InputStream bodyInputStr
private InputStream getEncryptedResponse(byte[] header, InputStream bodyInputStream, PrivateKey privateKey, String startCoordinate, String endCoordinate, String publicKey) throws GeneralSecurityException, IOException {
PublicKey recipientPublicKey = KeyUtils.getInstance().readPublicKey(publicKey);
Header newHeader = Crypt4GHUtils.getInstance().setRecipient(header, privateKey, recipientPublicKey);
if (!StringUtils.isEmpty(startCoordinate) && !StringUtils.isEmpty(endCoordinate)) {
if (StringUtils.hasLength(startCoordinate) && StringUtils.hasLength(endCoordinate)) {
DataEditList dataEditList = new DataEditList(new long[]{Long.parseLong(startCoordinate), Long.parseLong(endCoordinate)});
HeaderPacket dataEditListHeaderPacket = new X25519ChaCha20IETFPoly1305HeaderPacket(dataEditList, privateKey, recipientPublicKey);
newHeader.getHeaderPackets().add(dataEditListHeaderPacket);
Expand Down

0 comments on commit b61acef

Please sign in to comment.