From eb8d6d1bd97b0a697d05ebd5a3b31fb62ccae9e0 Mon Sep 17 00:00:00 2001 From: Michael Dowling Date: Mon, 26 Aug 2019 19:52:51 -0700 Subject: [PATCH] Clean up CodeWriter modifiers Makes it possible to override toString (something that is needed when the CodeWriter is doing things like managing imports), and makes a couple of methods final that should have already of been final. --- .../java/software/amazon/smithy/utils/CodeWriter.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java index e63a53c7f8e..b77bdece2cd 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeWriter.java @@ -415,7 +415,7 @@ public static String formatLiteral(Object value) { * @param formatter Formatter function that formats the given object as a String. * @return Returns the CodeWriter. */ - public CodeWriter putFormatter(char identifier, BiFunction formatter) { + public final CodeWriter putFormatter(char identifier, BiFunction formatter) { this.formatter.putFormatter(identifier, formatter); return this; } @@ -430,7 +430,7 @@ public CodeWriter putFormatter(char identifier, BiFunction mappings) { + public final CodeWriter putContext(Map mappings) { mappings.forEach(currentState::putContext); return this; }