diff --git a/codegen/build.gradle.kts b/codegen/build.gradle.kts index 066306a5b..ab3afcdce 100644 --- a/codegen/build.gradle.kts +++ b/codegen/build.gradle.kts @@ -201,9 +201,9 @@ subprojects { * CheckStyle * ==================================================== */ - // apply(plugin = "checkstyle") + apply(plugin = "checkstyle") - // tasks["checkstyleTest"].enabled = false + tasks["checkstyleTest"].enabled = false /* * Tests diff --git a/codegen/gradle.properties b/codegen/gradle.properties index ba1c4b9ac..3f06b8d01 100644 --- a/codegen/gradle.properties +++ b/codegen/gradle.properties @@ -1,2 +1,2 @@ -smithyVersion=1.99.0 +smithyVersion=1.39.0 smithyGradleVersion=0.7.0 diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointClientPluginsGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointClientPluginsGenerator.java index 2fa9afd07..ae51cd219 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointClientPluginsGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointClientPluginsGenerator.java @@ -18,7 +18,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; - import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.codegen.core.SymbolProvider; import software.amazon.smithy.go.codegen.GoCodegenPlugin; diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointMiddlewareGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointMiddlewareGenerator.java index cb1fdb7d0..7cd43cc9d 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointMiddlewareGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointMiddlewareGenerator.java @@ -17,10 +17,9 @@ import static software.amazon.smithy.go.codegen.GoWriter.goTemplate; +import java.util.Iterator; import java.util.List; import java.util.Optional; -import java.util.Iterator; - import software.amazon.smithy.codegen.core.CodegenException; import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.codegen.core.SymbolProvider; @@ -106,7 +105,7 @@ private GoWriter.Writable generateMiddlewareType( return (GoWriter w) -> { w.openBlock("type $L struct {", "}", getMiddlewareObjectName(operationName), () -> { w.write("EndpointResolver $T", SymbolUtils.createValueSymbolBuilder("EndpointResolverV2").build()); - for(Iterator iter = parameters.iterator(); iter.hasNext();){ + for (Iterator iter = parameters.iterator(); iter.hasNext();) { if (iter.next().getBuiltIn().isPresent()) { for (GoIntegration integration : this.integrations) { var builtInHandlerOpt = integration.getEndpointBuiltinHandler(); @@ -296,7 +295,7 @@ private GoWriter.Writable generateLegacyResolverValidator() { private GoWriter.Writable generateBuiltInResolverInvocation(Parameters parameters) { return (GoWriter writer) -> { - for(Iterator iter = parameters.iterator(); iter.hasNext();){ + for (Iterator iter = parameters.iterator(); iter.hasNext();) { if (iter.next().getBuiltIn().isPresent()) { for (GoIntegration integration : this.integrations) { var builtInHandlerOpt = integration.getEndpointBuiltinHandler(); @@ -453,7 +452,7 @@ private GoWriter.Writable generateMiddlewareAdder( private GoWriter.Writable generateBuiltInInitialization(Parameters parameters) { return (GoWriter writer) -> { - for(Iterator iter = parameters.iterator(); iter.hasNext();){ + for (Iterator iter = parameters.iterator(); iter.hasNext();) { if (iter.next().getBuiltIn().isPresent()) { for (GoIntegration integration : this.integrations) { var builtInHandlerOpt = integration.getEndpointBuiltinHandler(); diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointParametersGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointParametersGenerator.java index cdb76dfee..cbc210108 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointParametersGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointParametersGenerator.java @@ -27,7 +27,6 @@ import java.util.Optional; import java.util.stream.Stream; import java.util.stream.StreamSupport; - import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.go.codegen.GoWriter; import software.amazon.smithy.go.codegen.SmithyGoDependency; @@ -209,7 +208,7 @@ public static Symbol parameterAsSymbol(Parameter parameter) { } public static boolean haveRequiredParameters(Parameters parameters) { - for(Iterator iter = parameters.iterator(); iter.hasNext();){ + for (Iterator iter = parameters.iterator(); iter.hasNext();) { if (iter.next().isRequired()) { return true; } diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointResolverGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointResolverGenerator.java index 499586fa5..37bee724b 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointResolverGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointResolverGenerator.java @@ -32,7 +32,6 @@ import java.util.Optional; import java.util.TreeMap; import java.util.logging.Logger; - import software.amazon.smithy.codegen.core.Symbol; import software.amazon.smithy.go.codegen.GoWriter; import software.amazon.smithy.go.codegen.SmithyGoDependency; @@ -45,15 +44,15 @@ import software.amazon.smithy.rulesengine.language.evaluation.type.OptionalType; import software.amazon.smithy.rulesengine.language.syntax.Identifier; import software.amazon.smithy.rulesengine.language.syntax.expressions.Expression; -import software.amazon.smithy.rulesengine.language.syntax.expressions.literal.Literal; +import software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor; import software.amazon.smithy.rulesengine.language.syntax.expressions.Reference; import software.amazon.smithy.rulesengine.language.syntax.expressions.functions.FunctionDefinition; import software.amazon.smithy.rulesengine.language.syntax.expressions.functions.IsSet; +import software.amazon.smithy.rulesengine.language.syntax.expressions.literal.Literal; import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter; import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameters; import software.amazon.smithy.rulesengine.language.syntax.rule.Condition; import software.amazon.smithy.rulesengine.language.syntax.rule.Rule; -import software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor; import software.amazon.smithy.rulesengine.language.syntax.rule.RuleValueVisitor; import software.amazon.smithy.utils.MapUtils; import software.amazon.smithy.utils.SmithyBuilder; @@ -61,7 +60,8 @@ public final class EndpointResolverGenerator { private static final String PARAMS_ARG_NAME = "params"; private static final String REALIZED_URL_VARIABLE_NAME = "uri"; - private static final String ERROR_MESSAGE_ENDOFTREE = "Endpoint resolution failed. Invalid operation or environment input."; + private static final String ERROR_MESSAGE_ENDOFTREE = + "Endpoint resolution failed. Invalid operation or environment input."; private static final Logger LOGGER = Logger.getLogger(EndpointResolverGenerator.class.getName()); private final Map commonCodegenArgs; @@ -148,7 +148,7 @@ private static String getMemberParameterName(Parameter p) { private GoWriter.Writable generateResolveMethodBody(EndpointRuleSet ruleset) { var scope = Scope.empty(); - for(Iterator iter = ruleset.getParameters().iterator(); iter.hasNext();){ + for (Iterator iter = ruleset.getParameters().iterator(); iter.hasNext();) { // Required parameters can be dereferenced directly so that read access are // always by value. // Optional parameters will be dereferenced via conditional checks. @@ -175,7 +175,7 @@ private GoWriter.Writable generateResolveMethodBody(EndpointRuleSet ruleset) { "validateParams", generateValidateParams(ruleset.getParameters()), "paramsWithDefaults", generateParamsWithDefaults(), "paramVars", (GoWriter.Writable) (GoWriter w) -> { - for(Iterator iter = ruleset.getParameters().iterator(); iter.hasNext();){ + for (Iterator iter = ruleset.getParameters().iterator(); iter.hasNext();) { Parameter param = iter.next(); if (!param.isRequired()) { continue; @@ -506,7 +506,7 @@ private static boolean isConditionalFnResultOptional(Condition condition, Expres return false; } - final boolean[] isOptionalResult = { false }; + final boolean[] isOptionalResult = {false}; fn.accept(new ExpressionVisitor.Default() { @Override public Void getDefault() { diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointTestsGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointTestsGenerator.java index 207fdc5cf..a57d34898 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointTestsGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/EndpointTestsGenerator.java @@ -42,7 +42,6 @@ import software.amazon.smithy.model.node.ObjectNode; import software.amazon.smithy.model.node.StringNode; import software.amazon.smithy.rulesengine.language.EndpointRuleSet; -import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameter; import software.amazon.smithy.rulesengine.language.syntax.parameters.Parameters; import software.amazon.smithy.rulesengine.traits.EndpointTestCase; import software.amazon.smithy.rulesengine.traits.ExpectedEndpoint; diff --git a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/ExpressionGenerator.java b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/ExpressionGenerator.java index 114434228..7c9d33d9e 100644 --- a/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/ExpressionGenerator.java +++ b/codegen/smithy-go-codegen/src/main/java/software/amazon/smithy/go/codegen/endpoints/ExpressionGenerator.java @@ -28,13 +28,13 @@ import software.amazon.smithy.model.SourceLocation; import software.amazon.smithy.rulesengine.language.syntax.Identifier; import software.amazon.smithy.rulesengine.language.syntax.expressions.Expression; -import software.amazon.smithy.rulesengine.language.syntax.expressions.literal.Literal; +import software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor; import software.amazon.smithy.rulesengine.language.syntax.expressions.Reference; import software.amazon.smithy.rulesengine.language.syntax.expressions.Template; +import software.amazon.smithy.rulesengine.language.syntax.expressions.TemplateVisitor; import software.amazon.smithy.rulesengine.language.syntax.expressions.functions.FunctionDefinition; import software.amazon.smithy.rulesengine.language.syntax.expressions.functions.GetAttr; -import software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor; -import software.amazon.smithy.rulesengine.language.syntax.expressions.TemplateVisitor; +import software.amazon.smithy.rulesengine.language.syntax.expressions.literal.Literal; import software.amazon.smithy.rulesengine.language.syntax.expressions.literal.LiteralVisitor; import software.amazon.smithy.utils.MapUtils; import software.amazon.smithy.utils.StringUtils;