From 1d4d82f16376c24fa8bd93bd94470ae62da7591f Mon Sep 17 00:00:00 2001 From: Andreas Marek Date: Mon, 9 Jan 2023 19:30:38 +1000 Subject: [PATCH 1/2] 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` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2c0f6ab14..7896336f5 100644 --- a/README.md +++ b/README.md @@ -122,12 +122,12 @@ public class StringExample { // The AWS Encryption SDK may add information to the encryption context, so check to // ensure all of the values that you specified when encrypting are *included* in the returned encryption context. - if (!context.entrySet().stream + if (!context.entrySet().stream() .allMatch( e -> e.getValue().equals(decryptResult.getEncryptionContext().get(e.getKey())))) { throw new IllegalStateException("Wrong Encryption Context!"); } - assert Arrays.equals(decryptResult.getResult(), data.getBytes(StandardCharsets.UTF_8)); + assert Arrays.equals(decryptResult.getResult(), plaintext.getBytes(StandardCharsets.UTF_8)); // The data is correct, so return it. System.out.println("Decrypted: " + new String(decryptResult.getResult(), StandardCharsets.UTF_8)); From 67d34bf49305c028ba84f9ce27eaf62b7adc2527 Mon Sep 17 00:00:00 2001 From: Andy Jewell Date: Mon, 9 Jan 2023 15:14:32 -0500 Subject: [PATCH 2/2] fix: example code in README