diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 2f78a442..0fc78854 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -205,6 +205,10 @@ subprojects { tasks["checkstyleTest"].enabled = false + checkstyle { + toolVersion = "10.17.0" + } + /* * Tests * ==================================================== diff --git a/codegen/config/checkstyle/checkstyle.xml b/codegen/config/checkstyle/checkstyle.xml index 533472fb..267b8868 100644 --- a/codegen/config/checkstyle/checkstyle.xml +++ b/codegen/config/checkstyle/checkstyle.xml @@ -78,7 +78,7 @@ - + diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoWriter.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoWriter.java index 25dc1e1c..ec1c41f4 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoWriter.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/GoWriter.java @@ -932,7 +932,7 @@ private String formatWithNamespace(Symbol symbol) { * Implements Go symbol formatting for the {@code $P} formatter. This is identical to the $T * formatter, except that it will add a * to symbols that can be pointers. */ - private class PointableGoSymbolFormatter extends GoSymbolFormatter { + private final class PointableGoSymbolFormatter extends GoSymbolFormatter { @Override public String apply(Object type, String indent) { String formatted = super.apply(type, indent); @@ -957,7 +957,7 @@ private boolean isPointer(Object type) { } } - class GoWritableInjector extends GoSymbolFormatter { + private final class GoWritableInjector extends GoSymbolFormatter { @Override public String apply(Object type, String indent) { if (!(type instanceof Writable)) { @@ -975,7 +975,7 @@ public String apply(Object type, String indent) { /** * Implements Go symbol formatting for the {@code $D} formatter. */ - private class GoDependencyFormatter implements BiFunction { + private final class GoDependencyFormatter implements BiFunction { @Override public String apply(Object type, String indent) { if (type instanceof GoDependency) { diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java index e34f98ed..22fbc7a4 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/integration/ProtocolGenerator.java @@ -496,7 +496,7 @@ default void generateAuth(GenerationContext context) { /** * Context object used for service serialization and deserialization. */ - class GenerationContext { + final class GenerationContext { private final GoSettings settings; private final Model model; private final ServiceShape service;