Skip to content

Commit b3f5b00

Browse files
fix: Fix errors in the example code in README.md (#1306)
* Fix errors in the example code There are two small errors in the example that cause compile errors: - `.stream` instead of `.stream()` - `data.getBytes` instead of `plaintext.getBytes` * fix: example code in README Co-authored-by: Andreas Marek <[email protected]>
1 parent cd08a3b commit b3f5b00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,12 @@ public class StringExample {
122122

123123
// The AWS Encryption SDK may add information to the encryption context, so check to
124124
// ensure all of the values that you specified when encrypting are *included* in the returned encryption context.
125-
if (!context.entrySet().stream
125+
if (!context.entrySet().stream()
126126
.allMatch( e -> e.getValue().equals(decryptResult.getEncryptionContext().get(e.getKey())))) {
127127
throw new IllegalStateException("Wrong Encryption Context!");
128128
}
129129

130-
assert Arrays.equals(decryptResult.getResult(), data.getBytes(StandardCharsets.UTF_8));
130+
assert Arrays.equals(decryptResult.getResult(), plaintext.getBytes(StandardCharsets.UTF_8));
131131

132132
// The data is correct, so return it.
133133
System.out.println("Decrypted: " + new String(decryptResult.getResult(), StandardCharsets.UTF_8));

0 commit comments

Comments
 (0)