From a615fdb71a7c51042065733b3894d21bfd64e293 Mon Sep 17 00:00:00 2001 From: Luc Talatinian Date: Wed, 17 Jul 2024 14:23:34 -0400 Subject: [PATCH] upgrade to checkstyle 10.17.0 --- codegen/build.gradle.kts | 4 ++++ codegen/config/checkstyle/checkstyle.xml | 2 +- .../java/software/amazon/smithy/go/codegen/GoWriter.java | 6 +++--- .../smithy/go/codegen/integration/ProtocolGenerator.java | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) 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;