Skip to content

Commit 1564b49

Browse files
committed
more code comments
1 parent e8914d4 commit 1564b49

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

src/test/java/software/amazon/encryption/s3/S3AsyncEncryptionClientTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ public void copyObjectTransparentlyAsync() {
729729
* Test which artificially limits the size of buffers using {@link TinyBufferAsyncRequestBody}.
730730
* This tests edge cases where network conditions result in buffers with length shorter than
731731
* the cipher's block size.
732+
* Note that TinyAsyncRequestBody is not fully spec-compliant, and will cause IllegalStateExceptions
733+
* to be logged when debug logging is enabled.
732734
* @throws IOException
733735
*/
734736
@Test

src/test/java/software/amazon/encryption/s3/S3EncryptionClientRangedGetCompatibilityTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public void AsyncAesCbcV1toV3RangedGet(Object keyMaterial) {
264264
assertEquals("klmnopqrst0", output);
265265

266266
// Valid start index within input and end index out of range, returns object from start index to End of Stream
267+
// This causes a spurious NPE to be logged when debug logging is enabled.
267268
objectResponse = v3Client.getObject(builder -> builder
268269
.bucket(BUCKET)
269270
.range("bytes=190-300")
@@ -288,6 +289,7 @@ public void AsyncAesCbcV1toV3RangedGet(Object keyMaterial) {
288289
assertEquals(input, output);
289290

290291
// Invalid range starting index and ending index greater than object length but within Cipher Block size, returns empty object
292+
// This causes a spurious NPE to be logged when debug logging is enabled.
291293
objectResponse = v3Client.getObject(builder -> builder
292294
.bucket(BUCKET)
293295
.range("bytes=216-217")

src/test/java/software/amazon/encryption/s3/utils/TinyBufferAsyncRequestBody.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
* AsyncRequestBody which wraps another AsyncRequestBody with a {@link TinyBufferSubscriber}.
1111
* This is useful for testing poor network conditions where buffers may not be larger than
1212
* the cipher's block size.
13+
* DO NOT USE THIS IN PRODUCTION. In addition to degraded performance,
14+
* it will cause IllegalStateExceptions in the base Subscriber as it does not comply
15+
* with the Reactive Streaming spec.
1316
*/
1417
public class TinyBufferAsyncRequestBody implements AsyncRequestBody {
1518

0 commit comments

Comments
 (0)