Skip to content

Commit 9470ce1

Browse files
Fix static analysis
1 parent 37d57b5 commit 9470ce1

File tree

2 files changed

+19
-20
lines changed

2 files changed

+19
-20
lines changed

src/main/java/com/amazonaws/encryptionsdk/model/CiphertextHeaders.java

+15-17
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,6 @@ private int parseComplete(final byte[] b, final int off) throws ParseException {
503503
return 0;
504504
}
505505

506-
507506
/**
508507
* Deserialize the provided bytes starting at the specified offset to construct an instance of
509508
* this class. Uses the default value for maxEncryptedDataKeys, which results in no limit.
@@ -520,20 +519,20 @@ public int deserialize(final byte[] b, final int off) throws ParseException {
520519
return deserialize(b, off, NO_MAX_ENCRYPTED_DATA_KEYS);
521520
}
522521

523-
/**
524-
* Deserialize the provided bytes starting at the specified offset to construct an instance of
525-
* this class.
526-
*
527-
* <p>This method parses the provided bytes for the individual fields in this class. This method
528-
* also supports partial parsing where not all the bytes required for parsing the fields
529-
* successfully are available.
530-
*
531-
* @param b the byte array to deserialize.
532-
* @param off the offset in the byte array to use for deserialization.
533-
* @param maxEncryptedDataKeys the maximum number of EDKs to deserialize; zero indicates no
534-
* maximum
535-
* @return the number of bytes consumed in deserialization.
536-
*/
522+
/**
523+
* Deserialize the provided bytes starting at the specified offset to construct an instance of
524+
* this class.
525+
*
526+
* <p>This method parses the provided bytes for the individual fields in this class. This method
527+
* also supports partial parsing where not all the bytes required for parsing the fields
528+
* successfully are available.
529+
*
530+
* @param b the byte array to deserialize.
531+
* @param off the offset in the byte array to use for deserialization.
532+
* @param maxEncryptedDataKeys the maximum number of EDKs to deserialize; zero indicates no
533+
* maximum
534+
* @return the number of bytes consumed in deserialization.
535+
*/
537536
public int deserialize(final byte[] b, final int off, int maxEncryptedDataKeys)
538537
throws ParseException {
539538
if (b == null) {
@@ -853,8 +852,7 @@ public void setSuiteData(byte[] suiteData) {
853852
}
854853

855854
/**
856-
* Return max encrypted data keys
857-
* Package scope for unit testing.
855+
* Return max encrypted data keys. Package scope for unit testing.
858856
*
859857
* @return int
860858
*/

src/test/java/com/amazonaws/encryptionsdk/model/CiphertextHeadersTest.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ public void serializeDeserialize() {
6161

6262
final byte[] headerBytes = ciphertextHeaders.toByteArray();
6363
final CiphertextHeaders reconstructedHeaders = new CiphertextHeaders();
64-
reconstructedHeaders.deserialize(
65-
headerBytes, 0, maxEncryptedDataKeys);
64+
reconstructedHeaders.deserialize(headerBytes, 0, maxEncryptedDataKeys);
6665
final byte[] reconstructedHeaderBytes = reconstructedHeaders.toByteArray();
6766

6867
assertEquals(reconstructedHeaders.getMaxEncryptedDataKeys(), maxEncryptedDataKeys);
@@ -83,7 +82,9 @@ public void serializeDeserializeDefaultMaxEncryptedDataKeys() {
8382
reconstructedHeaders.deserialize(headerBytes, 0);
8483
final byte[] reconstructedHeaderBytes = reconstructedHeaders.toByteArray();
8584

86-
assertEquals(reconstructedHeaders.getMaxEncryptedDataKeys(), CiphertextHeaders.NO_MAX_ENCRYPTED_DATA_KEYS);
85+
assertEquals(
86+
reconstructedHeaders.getMaxEncryptedDataKeys(),
87+
CiphertextHeaders.NO_MAX_ENCRYPTED_DATA_KEYS);
8788
assertArrayEquals(headerBytes, reconstructedHeaderBytes);
8889
}
8990
}

0 commit comments

Comments
 (0)