From b3f5b0021efeeee507c5bd3bcf2b8ec1720acfc4 Mon Sep 17 00:00:00 2001 From: Andrew Jewell <107044381+ajewellamz@users.noreply.github.com> Date: Mon, 9 Jan 2023 16:02:50 -0500 Subject: [PATCH] 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 --- 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));