diff --git a/config/spotless/formatting.xml b/config/spotless/formatting.xml index b2a696360ee..9c93ae8a0e6 100644 --- a/config/spotless/formatting.xml +++ b/config/spotless/formatting.xml @@ -363,7 +363,8 @@ - + diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java index ec16e592a8c..181ce79dc28 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddAuthorizers.java @@ -64,7 +64,8 @@ public Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { // Only modify requirements that exactly match the updated scheme. if (requirement.size() != 1 || !requirement.keySet().iterator().next().equals(converter.getOpenApiAuthSchemeName())) { @@ -87,7 +88,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { ServiceShape service = context.getService(); AuthorizerIndex authorizerIndex = AuthorizerIndex.of(context.getModel()); @@ -142,7 +144,8 @@ public OpenApi after(Context context, OpenApi openapi) { private OpenApi addComputedAuthorizers( Context context, OpenApi openApi, - AuthorizersTrait trait) { + AuthorizersTrait trait + ) { OpenApi.Builder builder = openApi.toBuilder(); ComponentsObject.Builder components = openApi.getComponents().toBuilder(); @@ -167,7 +170,8 @@ private OpenApi addComputedAuthorizers( private boolean isAuthConverterMatched( Context context, SecuritySchemeConverter converter, - ShapeId scheme) { + ShapeId scheme + ) { return converter.getAuthSchemeId().equals(scheme) && context.getService().hasTrait(converter.getAuthSchemeType()); } @@ -176,7 +180,8 @@ private SecurityScheme convertAuthScheme( Context context, SecuritySchemeConverter converter, AuthorizerDefinition authorizer, - String authorizerName) { + String authorizerName + ) { T authTrait = context.getService().expectTrait(converter.getAuthSchemeType()); SecurityScheme createdScheme = converter.createSecurityScheme(context, authTrait); SecurityScheme.Builder schemeBuilder = createdScheme.toBuilder(); diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java index 14bc2327155..f68adfdbdeb 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsPreflightIntegration.java @@ -81,7 +81,8 @@ private static PathItem addPreflightIntegration( Context context, String path, PathItem pathItem, - CorsTrait corsTrait) { + CorsTrait corsTrait + ) { // Filter out any path for which an OPTIONS handler has already been defined if (pathItem.getOptions().isPresent()) { LOGGER.fine(() -> path + " already defines an OPTIONS request, so no need to generate CORS-preflight"); @@ -99,7 +100,8 @@ private static Map deduceCorsHeaders( Context context, String path, PathItem pathItem, - CorsTrait corsTrait) { + CorsTrait corsTrait + ) { Map corsHeaders = new HashMap<>(); corsHeaders.put(CorsHeader.MAX_AGE, String.valueOf(corsTrait.getMaxAge())); corsHeaders.put(CorsHeader.ALLOW_ORIGIN, corsTrait.getOrigin()); @@ -153,7 +155,8 @@ private static Map deduceCorsHeaders( private static Set getSecuritySchemeRequestHeaders( Context context, - SecuritySchemeConverter converter) { + SecuritySchemeConverter converter + ) { T t = context.getService().expectTrait(converter.getAuthSchemeType()); return converter.getAuthRequestHeaders(context, t); } @@ -179,7 +182,8 @@ private static OperationObject createPreflightOperation( Context context, String path, PathItem pathItem, - Map headers) { + Map headers + ) { return OperationObject.builder() .tags(ListUtils.of("CORS")) .security(Collections.emptyList()) @@ -226,7 +230,8 @@ private static ResponseObject createPreflightResponse(Map he private static ObjectNode createPreflightIntegration( Context context, Map headers, - PathItem pathItem) { + PathItem pathItem + ) { IntegrationResponse.Builder responseBuilder = IntegrationResponse.builder().statusCode("200"); // Add each CORS header to the mock integration response. diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsResponseHeaders.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsResponseHeaders.java index 6c88df7fe26..6986461772c 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsResponseHeaders.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsResponseHeaders.java @@ -44,7 +44,8 @@ public OperationObject postProcessOperation( OperationShape shape, OperationObject operation, String method, - String path) { + String path + ) { return context.getService() .getTrait(CorsTrait.class) .map(trait -> addCorsHeadersToResponses(context, shape, operation, method, trait)) @@ -56,7 +57,8 @@ private OperationObject addCorsHeadersToResponses( OperationShape shape, OperationObject operationObject, String method, - CorsTrait trait) { + CorsTrait trait + ) { OperationObject.Builder builder = operationObject.toBuilder(); for (Map.Entry entry : operationObject.getResponses().entrySet()) { @@ -79,7 +81,8 @@ private ResponseObject createUpdatedResponseWithCorsHeaders( OperationObject operationObject, String method, CorsTrait trait, - ResponseObject response) { + ResponseObject response + ) { // Determine which headers have been added to the response. List headers = new ArrayList<>(); diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToGatewayResponses.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToGatewayResponses.java index 88dd236dd0f..08e7c5f3ebc 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToGatewayResponses.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToGatewayResponses.java @@ -88,7 +88,8 @@ private Node updateGatewayResponses(Context context, CorsTrait private Node updateGatewayResponses( Context context, CorsTrait trait, - ObjectNode gatewayResponses) { + ObjectNode gatewayResponses + ) { Map corsHeaders = new HashMap<>(); corsHeaders.put(CorsHeader.ALLOW_ORIGIN, trait.getOrigin()); @@ -110,7 +111,8 @@ private ObjectNode updateGatewayResponse( Context context, CorsTrait trait, Map sharedHeaders, - ObjectNode gatewayResponse) { + ObjectNode gatewayResponse + ) { ObjectNode responseParameters = gatewayResponse .getObjectMember(RESPONSE_PARAMETERS_KEY) .orElse(Node.objectNode()); diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToRestIntegrations.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToRestIntegrations.java index 42e6e5ed3fb..7bc83f5777a 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToRestIntegrations.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddCorsToRestIntegrations.java @@ -51,7 +51,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operationObject, String httpMethod, - String path) { + String path + ) { CorsTrait cors = context.getService().getTrait(CorsTrait.class).orElse(null); if (cors == null) { @@ -69,7 +70,8 @@ private OperationObject updateOperation( OperationShape shape, OperationObject operationObject, CorsTrait cors, - ObjectNode integrationObject) { + ObjectNode integrationObject + ) { ObjectNode updated = updateIntegrationWithCors( context, operationObject, @@ -87,7 +89,8 @@ private ObjectNode updateIntegrationWithCors( OperationObject operationObject, OperationShape shape, ObjectNode integrationNode, - CorsTrait cors) { + CorsTrait cors + ) { ObjectNode responses = integrationNode.getObjectMember(RESPONSES_KEY).orElse(Node.objectNode()); // Always include a "default" response that has the same HTTP response code. @@ -132,7 +135,8 @@ private ObjectNode updateIntegrationResponse( OperationShape shape, Map corsHeaders, Set deduced, - ObjectNode response) { + ObjectNode response + ) { Map responseHeaders = new HashMap<>(corsHeaders); ObjectNode responseParams = response.getObjectMember(RESPONSE_PARAMETERS_KEY).orElseGet(Node::objectNode); diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java index b8df78b4bb1..3988bcbb062 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddIntegrations.java @@ -41,7 +41,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethod, - String path) { + String path + ) { IntegrationTraitIndex index = IntegrationTraitIndex.of(context.getModel()); return index.getIntegrationTrait(context.getService(), shape) .map(trait -> operation.toBuilder() @@ -62,7 +63,8 @@ static ObjectNode createIntegration(MockIntegrationTrait integration) { private static ObjectNode createIntegration( Context context, OperationShape shape, - Trait integration) { + Trait integration + ) { ObjectNode integrationNode; if (integration instanceof MockIntegrationTrait) { integrationNode = integration.toNode().expectObjectNode().withMember("type", Node.from("mock")); @@ -86,7 +88,8 @@ private static ObjectNode createIntegration( private static void validateTraitConfiguration( IntegrationTrait trait, Context context, - OperationShape operation) { + OperationShape operation + ) { // For HTTP APIs, API Gateway requires that the payloadFormatVersion is set on integrations. // https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-integration.html // If the payloadFormatVersion has not been set on an integration and the apiGatewayType has been set to "HTTP", diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java index c78780e31dd..d1b90b1391d 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/AddRequestValidators.java @@ -57,7 +57,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethod, - String path) { + String path + ) { return shape.getTrait(RequestValidatorTrait.class) .map(RequestValidatorTrait::getValue) .map(value -> operation.toBuilder().putExtension(REQUEST_VALIDATOR, value).build()) diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayMapper.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayMapper.java index 36eed9aa61f..d2eea9972ca 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayMapper.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/ApiGatewayMapper.java @@ -95,7 +95,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { return matchesApiType(context) ? delegate.updateOperation(context, shape, operation, httpMethodName, path) : operation; @@ -107,7 +108,8 @@ public OperationObject postProcessOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { return matchesApiType(context) ? delegate.postProcessOperation(context, shape, operation, httpMethodName, path) : operation; @@ -126,7 +128,8 @@ public ParameterObject updateParameter( OperationShape operation, String httpMethodName, String path, - ParameterObject parameterObject) { + ParameterObject parameterObject + ) { return matchesApiType(context) ? delegate.updateParameter(context, operation, httpMethodName, path, parameterObject) : parameterObject; @@ -138,7 +141,8 @@ public RequestBodyObject updateRequestBody( OperationShape operation, String httpMethodName, String path, - RequestBodyObject requestBody) { + RequestBodyObject requestBody + ) { return matchesApiType(context) ? delegate.updateRequestBody(context, operation, httpMethodName, path, requestBody) : requestBody; @@ -151,7 +155,8 @@ public ResponseObject updateResponse( String status, String httpMethodName, String path, - ResponseObject response) { + ResponseObject response + ) { return matchesApiType(context) ? delegate.updateResponse(context, operation, status, httpMethodName, path, response) : response; @@ -168,7 +173,8 @@ public void before(Context context, OpenApi.Builder builder) { public SecurityScheme updateSecurityScheme( Context context, Trait authTrait, - SecurityScheme securityScheme) { + SecurityScheme securityScheme + ) { return matchesApiType(context) ? delegate.updateSecurityScheme(context, authTrait, securityScheme) : securityScheme; @@ -179,7 +185,8 @@ public Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { return matchesApiType(context) ? delegate.updateSecurity(context, shape, converter, requirement) : requirement; diff --git a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/CorsHeader.java b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/CorsHeader.java index 212ca6b0fae..5afcc6d1404 100644 --- a/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/CorsHeader.java +++ b/smithy-aws-apigateway-openapi/src/main/java/software/amazon/smithy/aws/apigateway/openapi/CorsHeader.java @@ -37,7 +37,8 @@ static Set deduceOperationResponseHeaders( Context context, OperationObject operationObject, OperationShape shape, - CorsTrait cors) { + CorsTrait cors + ) { // The deduced response headers of an operation consist of any headers // returned by security schemes, any headers returned by the protocol, // and any headers explicitly modeled on the operation. diff --git a/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java index 7db17edbb8d..82653c884b1 100644 --- a/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java +++ b/smithy-aws-apigateway-traits/src/main/java/software/amazon/smithy/aws/apigateway/traits/AuthorizersTraitValidator.java @@ -58,7 +58,8 @@ private List validate(Model model, ServiceShape service) { private Optional validateAuthSchema( Map authorizers, Model model, - ServiceShape service) { + ServiceShape service + ) { Set authSchemes = ServiceIndex.of(model).getAuthSchemes(service).keySet(); String invalidMappings = authorizers.entrySet() @@ -89,7 +90,8 @@ private Optional validateAuthSchema( */ private Optional validateEnableSimpleResponsesConfig( Map authorizers, - ServiceShape service) { + ServiceShape service + ) { String invalidConfigs = authorizers.entrySet() .stream() .filter(entry -> entry.getValue().getEnableSimpleResponses().isPresent()) diff --git a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResource.java b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResource.java index dbe0c1ffefe..d1a055beb0b 100644 --- a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResource.java +++ b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResource.java @@ -222,7 +222,8 @@ public Builder putPropertyDefinition(String propertyName, CfnResourceProperty de public Builder updatePropertyDefinition( String propertyName, - Function updater) { + Function updater + ) { CfnResourceProperty definition = propertyDefinitions.get(propertyName); // Don't update if we don't have a property or it's already locked. diff --git a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java index 297570490e1..fc72dc1eb14 100644 --- a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java +++ b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourceIndex.java @@ -200,7 +200,8 @@ private boolean identifierIsInherited(String identifier, Set pare private void setIdentifierMutabilities( CfnResource.Builder builder, ResourceShape resource, - Set parentResources) { + Set parentResources + ) { Set defaultIdentifierMutability = getDefaultIdentifierMutabilities(resource); resource.getIdentifiers().forEach((name, shape) -> { @@ -239,7 +240,8 @@ private List> computeResourceAdditionalIdentifiers(Structur private void addAdditionalIdentifiers( CfnResource.Builder builder, - List> addedIdentifiers) { + List> addedIdentifiers + ) { if (addedIdentifiers.isEmpty()) { return; } @@ -264,7 +266,8 @@ private void updatePropertyMutabilities( ShapeId operationId, StructureShape propertyContainer, Set defaultMutabilities, - Function, Set> updater) { + Function, Set> updater + ) { // Handle the @excludeProperty trait. propertyContainer.accept(new ExcludedPropertiesVisitor(model)) .forEach(builder::addExcludedProperty); @@ -301,7 +304,8 @@ private void updatePropertyMutabilities( private Function getCfnResourcePropertyUpdater( MemberShape member, Set explicitMutability, - Function, Set> updater) { + Function, Set> updater + ) { return definition -> { CfnResourceProperty.Builder builder = definition.toBuilder().addShapeId(member.getId()); @@ -322,7 +326,8 @@ private boolean inputOperationMemberIsIdentifier( Model model, ShapeId resourceId, ShapeId operationId, - MemberShape member) { + MemberShape member + ) { // The operationId will be null in the case of additionalSchemas, so // we shouldn't worry if these are bound to operation identifiers. if (operationId == null) { @@ -344,7 +349,8 @@ private boolean inputOperationMemberIsIdentifier( private Set getExplicitMutability( Model model, - MemberShape member) { + MemberShape member + ) { Optional traitOptional = member.getMemberTrait(model, CfnMutabilityTrait.class); if (!traitOptional.isPresent()) { return SetUtils.of(); diff --git a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java index 45636a41976..6d828267347 100644 --- a/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java +++ b/smithy-aws-cloudformation-traits/src/main/java/software/amazon/smithy/aws/cloudformation/traits/CfnResourcePropertyValidator.java @@ -38,7 +38,8 @@ public List validate(Model model) { private List validateResource( Model model, CfnResourceIndex cfnResourceIndex, - ResourceShape resource) { + ResourceShape resource + ) { CfnResourceTrait trait = resource.expectTrait(CfnResourceTrait.class); List events = new ArrayList<>(); String resourceName = trait.getName().orElse(resource.getId().getName()); @@ -58,7 +59,8 @@ private Optional validateResourceProperty( Model model, ResourceShape resource, String resourceName, - Map.Entry property) { + Map.Entry property + ) { Set propertyTargets = new TreeSet<>(); for (ShapeId shapeId : property.getValue().getShapeIds()) { model.getShape(shapeId).ifPresent(shape -> diff --git a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/CfnConverter.java b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/CfnConverter.java index dd80b3de13f..a954be3988e 100644 --- a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/CfnConverter.java +++ b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/CfnConverter.java @@ -178,7 +178,8 @@ private List createConversionEnvironments(Model model) { private ConversionEnvironment createConversionEnvironment( Model model, ServiceShape serviceShape, - ResourceShape resourceShape) { + ResourceShape resourceShape + ) { // Prepare the JSON Schema Converter. JsonSchemaConverter.Builder jsonSchemaConverterBuilder = JsonSchemaConverter.builder() .config(config) @@ -250,7 +251,8 @@ private static final class ConversionEnvironment { private ConversionEnvironment( Context context, - List mappers) { + List mappers + ) { this.context = context; this.mappers = mappers; } @@ -307,7 +309,8 @@ private ResourceSchema convertResource(ConversionEnvironment environment, Resour private String resolveResourceTypeName( ConversionEnvironment environment, - CfnResourceTrait resourceTrait) { + CfnResourceTrait resourceTrait + ) { CfnConfig config = environment.context.getConfig(); ServiceShape serviceShape = environment.context.getModel().expectShape(config.getService(), ServiceShape.class); Optional serviceTrait = serviceShape.getTrait(ServiceTrait.class); diff --git a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/Context.java b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/Context.java index a0962caf98d..d3d2c720293 100644 --- a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/Context.java +++ b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/Context.java @@ -35,7 +35,8 @@ public final class Context { CfnResource cfnResource, StructureShape resourceStructure, CfnConfig config, - JsonSchemaConverter jsonSchemaConverter) { + JsonSchemaConverter jsonSchemaConverter + ) { this.model = model; this.service = service; this.resource = resource; diff --git a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/TaggingMapper.java b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/TaggingMapper.java index c6a0bfea454..30084d4e3f2 100644 --- a/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/TaggingMapper.java +++ b/smithy-aws-cloudformation/src/main/java/software/amazon/smithy/aws/cloudformation/schema/fromsmithy/mappers/TaggingMapper.java @@ -40,7 +40,8 @@ public static void injectTagsMember( CfnConfig config, Model model, ResourceShape resource, - StructureShape.Builder builder) { + StructureShape.Builder builder + ) { String tagMemberName = getTagMemberName(config, resource); if (resource.hasTrait(TaggableTrait.class)) { AwsTagIndex tagIndex = AwsTagIndex.of(model); diff --git a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/language/functions/EndpointAuthUtils.java b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/language/functions/EndpointAuthUtils.java index 6887ac1e6b9..28e63101412 100644 --- a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/language/functions/EndpointAuthUtils.java +++ b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/language/functions/EndpointAuthUtils.java @@ -73,7 +73,8 @@ public static Endpoint.Builder sigv4(Endpoint.Builder builder, Literal signingRe public static Endpoint.Builder sigv4a( Endpoint.Builder builder, List signingRegionSet, - Literal signingService) { + Literal signingService + ) { return builder.addAuthScheme(SIGV4A, MapUtils.of( SIGNING_NAME, @@ -126,7 +127,8 @@ public boolean test(String name) { public List validateScheme( Map authScheme, FromSourceLocation sourceLocation, - BiFunction emitter) { + BiFunction emitter + ) { List events = noExtraProperties(emitter, sourceLocation, authScheme, @@ -147,7 +149,8 @@ public List validateScheme( private static List validateOptionalSharedProperties( Map authScheme, - BiFunction emitter) { + BiFunction emitter + ) { List events = new ArrayList<>(); // The following properties are only type checked if present. if (authScheme.containsKey(ID_SIGNING_NAME)) { @@ -175,7 +178,8 @@ public boolean test(String name) { public List validateScheme( Map authScheme, FromSourceLocation sourceLocation, - BiFunction emitter) { + BiFunction emitter + ) { List events = noExtraProperties(emitter, sourceLocation, authScheme, @@ -229,7 +233,8 @@ public boolean test(String name) { public List validateScheme( Map authScheme, FromSourceLocation sourceLocation, - BiFunction emitter) { + BiFunction emitter + ) { List events = hasAllKeys(emitter, authScheme, ListUtils.of(RuleSetAuthSchemesValidator.NAME, ID_SIGNING_NAME), @@ -248,7 +253,8 @@ private List hasAllKeys( BiFunction emitter, Map authScheme, List requiredKeys, - FromSourceLocation sourceLocation) { + FromSourceLocation sourceLocation + ) { List events = new ArrayList<>(); for (Identifier key : requiredKeys) { if (!authScheme.containsKey(key)) { @@ -271,7 +277,8 @@ public boolean test(String name) { public List validateScheme( Map authScheme, FromSourceLocation sourceLocation, - BiFunction emitter) { + BiFunction emitter + ) { List events = hasAllKeys(emitter, authScheme, ListUtils.of(RuleSetAuthSchemesValidator.NAME, ID_SIGNING_NAME), @@ -284,7 +291,8 @@ private List hasAllKeys( BiFunction emitter, Map authScheme, List requiredKeys, - FromSourceLocation sourceLocation) { + FromSourceLocation sourceLocation + ) { List events = new ArrayList<>(); for (Identifier key : requiredKeys) { if (!authScheme.containsKey(key)) { @@ -299,7 +307,8 @@ private static List noExtraProperties( BiFunction emitter, FromSourceLocation sourceLocation, Map properties, - List allowedProperties) { + List allowedProperties + ) { List events = new ArrayList<>(); for (Identifier propertyName : properties.keySet()) { if (!allowedProperties.contains(propertyName)) { @@ -315,7 +324,8 @@ private static List noExtraProperties( private static Optional validateBooleanProperty( BiFunction emitter, Map properties, - Identifier propertyName) { + Identifier propertyName + ) { return validatePropertyType(emitter, properties.get(propertyName), propertyName, @@ -326,7 +336,8 @@ private static Optional validateBooleanProperty( private static Optional validateStringProperty( BiFunction emitter, Map properties, - Identifier propertyName) { + Identifier propertyName + ) { return validatePropertyType(emitter, properties.get(propertyName), propertyName, @@ -339,7 +350,8 @@ private static Optional validatePropertyType( Literal value, Identifier propertyName, Function> validator, - String expectedType) { + String expectedType + ) { if (value == null) { return Optional.of(emitter.apply(propertyName, String.format("Expected auth property `%s` of %s type but didn't find one", diff --git a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/traits/StandardPartitionalEndpointsTrait.java b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/traits/StandardPartitionalEndpointsTrait.java index c981faccb6d..1c75f188a63 100644 --- a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/traits/StandardPartitionalEndpointsTrait.java +++ b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/traits/StandardPartitionalEndpointsTrait.java @@ -133,7 +133,8 @@ public static final class Builder extends AbstractTraitBuilder> partitionEndpointSpecialCases) { + Map> partitionEndpointSpecialCases + ) { this.partitionEndpointSpecialCases.clear(); this.partitionEndpointSpecialCases.get().putAll(partitionEndpointSpecialCases); return this; @@ -148,7 +149,8 @@ public Builder partitionEndpointSpecialCases( */ public Builder putPartitionEndpointSpecialCase( String partition, - List partitionEndpointSpecialCases) { + List partitionEndpointSpecialCases + ) { this.partitionEndpointSpecialCases.get().put(partition, partitionEndpointSpecialCases); return this; } diff --git a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/AwsSpecialCaseEndpointValidator.java b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/AwsSpecialCaseEndpointValidator.java index 481d1ed1299..fcecaa71f68 100644 --- a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/AwsSpecialCaseEndpointValidator.java +++ b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/AwsSpecialCaseEndpointValidator.java @@ -53,7 +53,8 @@ public List validate(Model model) { private List validateRegionalEndpointPatterns( ServiceShape serviceShape, - StandardRegionalEndpointsTrait regionalEndpoints) { + StandardRegionalEndpointsTrait regionalEndpoints + ) { List events = new ArrayList<>(); for (List specialCases : regionalEndpoints.getRegionSpecialCases().values()) { @@ -79,7 +80,8 @@ private List validateRegionalEndpointPatterns( private List validatePartitionalEndpointPatterns( ServiceShape serviceShape, - StandardPartitionalEndpointsTrait partitionalEndpoints) { + StandardPartitionalEndpointsTrait partitionalEndpoints + ) { List events = new ArrayList<>(); @@ -99,7 +101,8 @@ private List validatePartitionalEndpointPatterns( private List validateEndpointPatterns( ServiceShape serviceShape, FromSourceLocation location, - String endpoint) { + String endpoint + ) { List events = new ArrayList<>(); Matcher m = PATTERN.matcher(endpoint); diff --git a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/RuleSetAwsBuiltInValidator.java b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/RuleSetAwsBuiltInValidator.java index 26f7ceae1d0..e0c5cdd0663 100644 --- a/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/RuleSetAwsBuiltInValidator.java +++ b/smithy-aws-endpoints/src/main/java/software/amazon/smithy/rulesengine/aws/validators/RuleSetAwsBuiltInValidator.java @@ -54,7 +54,8 @@ private List validateRuleSetAwsBuiltIns(ServiceShape serviceSha private Optional validateBuiltIn( ServiceShape serviceShape, String builtInName, - FromSourceLocation source) { + FromSourceLocation source + ) { if (ADDITIONAL_CONSIDERATION_BUILT_INS.contains(builtInName)) { return Optional.of(danger( serviceShape, diff --git a/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java index 5376e9cfbe5..f1494ca7f6d 100644 --- a/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java +++ b/smithy-aws-iam-traits/src/main/java/software/amazon/smithy/aws/iam/traits/ConditionKeysIndex.java @@ -132,7 +132,8 @@ public Set getConditionKeyNames(ToShapeId service, ToShapeId resourceOrO */ public Map getDefinedConditionKeys( ToShapeId service, - ToShapeId resourceOrOperation) { + ToShapeId resourceOrOperation + ) { Map serviceDefinitions = getDefinedConditionKeys(service); Map definitions = new HashMap<>(); @@ -150,7 +151,8 @@ private void compute( ServiceShape service, String arnRoot, Shape subject, - ResourceShape parent) { + ResourceShape parent + ) { compute(model, service, arnRoot, subject, parent, SetUtils.of()); } @@ -160,7 +162,8 @@ private void compute( String arnRoot, Shape subject, ResourceShape parent, - Set parentDefinitions) { + Set parentDefinitions + ) { Set definitions = new HashSet<>(); if (!subject.hasTrait(IamResourceTrait.ID) || !subject.expectTrait(IamResourceTrait.class).isDisableConditionKeyInheritance()) { @@ -200,7 +203,8 @@ private Map inferChildResourceIdentifiers( ShapeId service, String arnRoot, ResourceShape resource, - ResourceShape parent) { + ResourceShape parent + ) { Map result = new HashMap<>(); // We want child resources to reuse parent resource context keys, so diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java index 5bf3dee7d2a..0d8b50334bb 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/ArnIndex.java @@ -75,7 +75,8 @@ private Pair> compileServiceArns(TopDownIndex in private void compileEffectiveArns( TopDownIndex index, IdentifierBindingIndex bindings, - ServiceShape service) { + ServiceShape service + ) { Map operationMappings = new HashMap<>(); effectiveArns.put(service.getId(), operationMappings); diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/HttpChecksumTraitValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/HttpChecksumTraitValidator.java index 19d0e84d99d..06613737195 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/HttpChecksumTraitValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/HttpChecksumTraitValidator.java @@ -95,7 +95,8 @@ private List validateRequestChecksumConfiguration( Model model, HttpChecksumTrait trait, OperationShape operation, - StructureShape input) { + StructureShape input + ) { List events = new ArrayList<>(); // Validate the requestAlgorithmMember is set properly for request behavior. @@ -111,7 +112,8 @@ private Optional validateAlgorithmMember( Model model, HttpChecksumTrait trait, OperationShape operation, - StructureShape input) { + StructureShape input + ) { // Validate that requestAlgorithmMember, if present, targets a properly configured member. if (trait.getRequestAlgorithmMember().isPresent()) { return validateEnumMember(model, @@ -133,7 +135,8 @@ private Optional validateEnumMember( OperationShape operation, StructureShape input, String memberName, - List supportedValues) { + List supportedValues + ) { Optional member = input.getMember(memberName); // There's no member that matches the configured name. if (!member.isPresent()) { @@ -229,7 +232,8 @@ private List validateResponseChecksumConfiguration( Model model, HttpChecksumTrait trait, OperationShape operation, - StructureShape input) { + StructureShape input + ) { List events = new ArrayList<>(); // Validate requestValidationModeMember is set properly for response behavior. @@ -270,7 +274,8 @@ private Optional validateValidationModeMember( Model model, HttpChecksumTrait trait, OperationShape operation, - StructureShape input) { + StructureShape input + ) { // Validate that requestValidationModeMember, which we've found already, targets a properly configured member. return validateEnumMember(model, trait, diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/SigV4TraitsValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/SigV4TraitsValidator.java index 26cf02e51a7..32fa5e8dcab 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/SigV4TraitsValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/SigV4TraitsValidator.java @@ -91,7 +91,8 @@ private ValidationEvent createValuesShouldMatchWarning( ShapeId member1, String value1, ShapeId member2, - String value2) { + String value2 + ) { return warning(service, String.format( "Value for `%s` \"%s\" and value for `%s` \"%s\" SHOULD match.", diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/diff/SigV4Migration.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/diff/SigV4Migration.java index fa5383b8303..512b436c7c8 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/diff/SigV4Migration.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/auth/diff/SigV4Migration.java @@ -113,7 +113,8 @@ private void validateMigration( Shape shape, List oldAuthSchemes, List newAuthSchemes, - List events) { + List events + ) { boolean isOldSigV4Present = oldAuthSchemes.contains(SigV4Trait.ID); boolean isOldSigV4APresent = oldAuthSchemes.contains(SigV4ATrait.ID); boolean isNewSigV4Present = newAuthSchemes.contains(SigV4Trait.ID); diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/CleanClientDiscoveryTraitTransformer.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/CleanClientDiscoveryTraitTransformer.java index 9ac09d7e790..313888ddec8 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/CleanClientDiscoveryTraitTransformer.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/CleanClientDiscoveryTraitTransformer.java @@ -66,7 +66,8 @@ private Set getServicesToUpdate(Model model, Set removedOperatio private Set getOperationsToUpdate( Model model, - Set updatedServices) { + Set updatedServices + ) { ClientEndpointDiscoveryIndex discoveryIndex = ClientEndpointDiscoveryIndex.of(model); Set stillBoundOperations = model.shapes(ServiceShape.class) // Get all endpoint discovery services diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryIndex.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryIndex.java index 730977aa813..18886acf937 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryIndex.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryIndex.java @@ -64,7 +64,8 @@ private Map getOperations( OperationShape endpointOperation, StructureShape endpointError, TopDownIndex topDownIndex, - OperationIndex opIndex) { + OperationIndex opIndex + ) { Map result = new HashMap<>(); for (OperationShape operation : topDownIndex.getContainedOperations(service)) { operation.getTrait(ClientDiscoveredEndpointTrait.class).ifPresent(trait -> { diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryInfo.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryInfo.java index 31ae67918d9..8265782c7d1 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryInfo.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryInfo.java @@ -26,7 +26,8 @@ public final class ClientEndpointDiscoveryInfo { OperationShape discoveryOperation, StructureShape error, List discoveryIds, - boolean required) { + boolean required + ) { this.service = service; this.operation = operation; this.discoveryOperation = discoveryOperation; diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java index 32a8a2f3f1d..5ae2a5ff172 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/clientendpointdiscovery/ClientEndpointDiscoveryValidator.java @@ -77,7 +77,8 @@ private List validateTrait(ServiceShape service, ClientEndpoint private List validateServices( ClientEndpointDiscoveryIndex discoveryIndex, - Map endpointDiscoveryServices) { + Map endpointDiscoveryServices + ) { List validationEvents = endpointDiscoveryServices.entrySet() .stream() .filter(pair -> !pair.getKey().getAllOperations().contains(pair.getValue().getOperation())) @@ -107,7 +108,8 @@ private List validateServices( private List validateOperations( Model model, ClientEndpointDiscoveryIndex discoveryIndex, - Map endpointDiscoveryServices) { + Map endpointDiscoveryServices + ) { return model.shapes(OperationShape.class) .filter(operation -> operation.hasTrait(ClientDiscoveredEndpointTrait.class)) .map(operation -> { @@ -153,7 +155,8 @@ private List validateOperation(OperationShape operation, List validateEndpointOperation( Model model, OperationIndex opIndex, - OperationShape operation) { + OperationShape operation + ) { List events = new ArrayList<>(); events.addAll(validateEndpointOperationInput(model, opIndex.expectInputShape(operation), operation)); StructureShape output = opIndex.expectOutputShape(operation); @@ -219,7 +222,8 @@ private List validateEndpointOperation( private List validateEndpointOperationInput( Model model, StructureShape input, - OperationShape operation) { + OperationShape operation + ) { List events = new ArrayList<>(); Set memberNames = SetUtils.copyOf(input.getMemberNames()); if (!VALID_INPUT_MEMBERS.containsAll(memberNames)) { diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java index deb7b5e17bb..f524c6adf03 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/protocols/ProtocolHttpPayloadValidator.java @@ -65,7 +65,8 @@ private List validateService( Model model, ServiceShape service, HttpBindingIndex bindingIndex, - TopDownIndex topDownIndex) { + TopDownIndex topDownIndex + ) { List events = new ArrayList<>(); for (OperationShape operation : topDownIndex.getContainedOperations(service)) { diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/AwsTagIndex.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/AwsTagIndex.java index 3e7abcc9ec7..173e6fe97d2 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/AwsTagIndex.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/AwsTagIndex.java @@ -214,7 +214,8 @@ private void computeTaggingApis(Model model, ServiceShape service) { private void calculateTagApi( Model model, ServiceShape service, - Map operationMap) { + Map operationMap + ) { TopDownIndex topDownIndex = TopDownIndex.of(model); OperationIndex operationIndex = OperationIndex.of(model); @@ -238,7 +239,8 @@ private void calculateTagApi( private void calculateUntagApi( Model model, ServiceShape service, - Map operationMap) { + Map operationMap + ) { TopDownIndex topDownIndex = TopDownIndex.of(model); OperationIndex operationIndex = OperationIndex.of(model); @@ -262,7 +264,8 @@ private void calculateUntagApi( private void calculateListTagsApi( Model model, ServiceShape service, - Map operationMap) { + Map operationMap + ) { TopDownIndex topDownIndex = TopDownIndex.of(model); OperationIndex operationIndex = OperationIndex.of(model); diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/ServiceTaggingValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/ServiceTaggingValidator.java index a5adfe682d1..c0aad92f26c 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/ServiceTaggingValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/ServiceTaggingValidator.java @@ -77,7 +77,8 @@ private ValidationEvent getInvalidOperationEvent( ServiceShape service, FromSourceLocation location, ShapeId opId, - String opName) { + String opName + ) { return danger(service, location, String.format("Shape `%s` does not satisfy '%s' operation requirements.", diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TagEnabledServiceValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TagEnabledServiceValidator.java index b690089a148..bbcf4b9301f 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TagEnabledServiceValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TagEnabledServiceValidator.java @@ -31,7 +31,8 @@ public List validate(Model model) { private List validateService( ServiceShape service, AwsTagIndex tagIndex, - TopDownIndex topDownIndex) { + TopDownIndex topDownIndex + ) { List events = new ArrayList<>(); TagEnabledTrait trait = service.expectTrait(TagEnabledTrait.class); diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggableResourceValidator.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggableResourceValidator.java index a92c2bca7e3..365b4673599 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggableResourceValidator.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggableResourceValidator.java @@ -60,7 +60,8 @@ private List validateResource( Model model, ResourceShape resource, ServiceShape service, - AwsTagIndex awsTagIndex) { + AwsTagIndex awsTagIndex + ) { List events = new ArrayList<>(); // Generate danger if resource has tag property in update API. if (awsTagIndex.isResourceTagOnUpdate(resource.getId())) { @@ -157,7 +158,8 @@ private boolean verifyTagApi(OperationShape tagApi, Model model) { private boolean exactlyOne( Collection> collection, - Predicate> test) { + Predicate> test + ) { int count = 0; for (Map.Entry entry : collection) { if (test.test(entry)) { diff --git a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggingShapeUtils.java b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggingShapeUtils.java index 5006b675dee..a5cd82acc53 100644 --- a/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggingShapeUtils.java +++ b/smithy-aws-traits/src/main/java/software/amazon/smithy/aws/traits/tagging/TaggingShapeUtils.java @@ -126,7 +126,8 @@ static boolean verifyTagKeysShape(Model model, Shape tagShape) { static boolean verifyTagResourceOperation( Model model, OperationShape tagResourceOperation, - OperationIndex operationIndex) { + OperationIndex operationIndex + ) { Map inputMembers = operationIndex.getInputMembers(tagResourceOperation); int taglistMemberCount = 0; for (Map.Entry memberEntry : inputMembers.entrySet()) { @@ -141,7 +142,8 @@ && verifyTagsShape(model, model.expectShape(memberEntry.getValue().getTarget())) static boolean verifyUntagResourceOperation( Model model, OperationShape untagResourceOperation, - OperationIndex operationIndex) { + OperationIndex operationIndex + ) { Map inputMembers = operationIndex.getInputMembers(untagResourceOperation); int untagKeyMemberCount = 0; for (Map.Entry memberEntry : inputMembers.entrySet()) { @@ -156,7 +158,8 @@ && verifyTagKeysShape(model, model.expectShape(memberEntry.getValue().getTarget( static boolean verifyListTagsOperation( Model model, OperationShape listTagsResourceOperation, - OperationIndex operationIndex) { + OperationIndex operationIndex + ) { Map inputMembers = operationIndex.getInputMembers(listTagsResourceOperation); Map outputMembers = operationIndex.getOutputMembers(listTagsResourceOperation); int taglistMemberCount = 0; @@ -172,7 +175,8 @@ && verifyTagsShape(model, model.expectShape(memberEntry.getValue().getTarget())) static boolean isTagPropertyInInput( Optional operationId, Model model, - ResourceShape resource) { + ResourceShape resource + ) { if (operationId.isPresent()) { PropertyBindingIndex propertyBindingIndex = PropertyBindingIndex.of(model); Optional property = resource.expectTrait(TaggableTrait.class).getProperty(); @@ -188,7 +192,8 @@ static boolean isTagPropertyInInput( static boolean isTagPropertyInShape( String tagPropertyName, Shape shape, - PropertyBindingIndex propertyBindingIndex) { + PropertyBindingIndex propertyBindingIndex + ) { for (MemberShape member : shape.members()) { Optional propertyName = propertyBindingIndex.getPropertyName(member.getId()); if (propertyName.isPresent() && propertyName.get().equals(tagPropertyName)) { diff --git a/smithy-build/src/main/java/software/amazon/smithy/build/ProjectionTransformer.java b/smithy-build/src/main/java/software/amazon/smithy/build/ProjectionTransformer.java index 954a951c5ca..dc8f6b4e102 100644 --- a/smithy-build/src/main/java/software/amazon/smithy/build/ProjectionTransformer.java +++ b/smithy-build/src/main/java/software/amazon/smithy/build/ProjectionTransformer.java @@ -64,7 +64,8 @@ static Function> createServiceFactory() * @return Returns the created factory. */ static Function> createServiceFactory( - Iterable transformers) { + Iterable transformers + ) { Map map = new HashMap<>(); for (ProjectionTransformer transformer : transformers) { map.put(transformer.getName(), transformer); diff --git a/smithy-build/src/main/java/software/amazon/smithy/build/SmithyBuildImpl.java b/smithy-build/src/main/java/software/amazon/smithy/build/SmithyBuildImpl.java index 26db203e4ae..4df3995e3f1 100644 --- a/smithy-build/src/main/java/software/amazon/smithy/build/SmithyBuildImpl.java +++ b/smithy-build/src/main/java/software/amazon/smithy/build/SmithyBuildImpl.java @@ -165,7 +165,8 @@ private static void validatePluginName(String projection, String plugin) { void applyAllProjections( Consumer projectionResultConsumer, - BiConsumer projectionExceptionConsumer) { + BiConsumer projectionExceptionConsumer + ) { ValidatedResult resolvedModel = createBaseModel(); // Some plugins need things like file locks and can't be run in parallel with other plugins. @@ -271,7 +272,8 @@ private void executeSerialProjection( ProjectionConfig config, List resolvedPlugins, Consumer projectionResultConsumer, - BiConsumer projectionExceptionConsumer) { + BiConsumer projectionExceptionConsumer + ) { // Errors that occur while invoking the result callback must not // cause the exception callback to be invoked. ProjectionResult result = null; @@ -301,7 +303,8 @@ private ProjectionResult applyProjection( String projectionName, ProjectionConfig projection, ValidatedResult baseModel, - List resolvedPlugins) throws Throwable { + List resolvedPlugins + ) throws Throwable { Model resolvedModel = baseModel.unwrap(); LOGGER.fine(() -> String.format("Creating the `%s` projection", projectionName)); @@ -394,7 +397,8 @@ private Model applyProjectionTransforms( ValidatedResult baseModel, Model currentModel, String projectionName, - Set visited) { + Set visited + ) { Model originalModel = baseModel.unwrap(); for (Pair transformerBinding : transformers.get(projectionName)) { @@ -423,7 +427,8 @@ private void applyPlugin( Model projectedModel, Model resolvedModel, ValidatedResult modelResult, - ProjectionResult.Builder resultBuilder) { + ProjectionResult.Builder resultBuilder + ) { PluginId id = resolvedPlugin.id; // Create the manifest where plugin artifacts are stored. @@ -456,7 +461,8 @@ private void applyPlugin( // transformer, and the right value is the instantiated transformer. private List> createTransformers( String projectionName, - ProjectionConfig config) { + ProjectionConfig config + ) { List> resolved = new ArrayList<>(config.getTransforms().size()); for (TransformConfig transformConfig : config.getTransforms()) { @@ -477,7 +483,8 @@ private Model applyQueuedProjections( Collection queuedProjections, TransformContext context, Model currentModel, - Set visited) { + Set visited + ) { LOGGER.fine(() -> String.format("Applying queued projections: %s", queuedProjections)); for (String projectionTarget : queuedProjections) { Set updatedVisited = new LinkedHashSet<>(visited); diff --git a/smithy-build/src/main/java/software/amazon/smithy/build/transforms/FilterSuppressions.java b/smithy-build/src/main/java/software/amazon/smithy/build/transforms/FilterSuppressions.java index 1bdcb571ae1..3e329bd17a6 100644 --- a/smithy-build/src/main/java/software/amazon/smithy/build/transforms/FilterSuppressions.java +++ b/smithy-build/src/main/java/software/amazon/smithy/build/transforms/FilterSuppressions.java @@ -265,7 +265,8 @@ private Model filterSuppressionTraits( Model model, Config config, List suppressedEvents, - ModelTransformer transformer) { + ModelTransformer transformer + ) { List replacementShapes = new ArrayList<>(); // First filter and '@suppress' traits that didn't suppress anything. @@ -296,7 +297,8 @@ private Model filterMetadata( Model model, Config config, List suppressedEvents, - Set removedValidators) { + Set removedValidators + ) { // Next remove metadata suppressions that didn't suppress anything. ArrayNode suppressionsNode = model.getMetadata() .getOrDefault("suppressions", Node.arrayNode()) diff --git a/smithy-build/src/main/java/software/amazon/smithy/build/transforms/TagUtils.java b/smithy-build/src/main/java/software/amazon/smithy/build/transforms/TagUtils.java index 597d3d77f0a..428b7315a28 100644 --- a/smithy-build/src/main/java/software/amazon/smithy/build/transforms/TagUtils.java +++ b/smithy-build/src/main/java/software/amazon/smithy/build/transforms/TagUtils.java @@ -32,7 +32,8 @@ private static Model includeExcludeShapeTags( ModelTransformer transformer, Model model, Set tags, - boolean exclude) { + boolean exclude + ) { return transformer.mapShapes(model, shape -> intersectIfChanged(shape.getTags(), tags, exclude) .map(intersection -> { @@ -46,7 +47,8 @@ private static Model includeExcludeShapeTags( private static Optional> intersectIfChanged( Collection subject, Collection other, - boolean exclude) { + boolean exclude + ) { Set temp = new HashSet<>(subject); if (exclude) { temp.removeAll(other); diff --git a/smithy-cli/src/it/java/software/amazon/smithy/cli/IntegUtils.java b/smithy-cli/src/it/java/software/amazon/smithy/cli/IntegUtils.java index 6c68d2ffd06..67a87c592b1 100644 --- a/smithy-cli/src/it/java/software/amazon/smithy/cli/IntegUtils.java +++ b/smithy-cli/src/it/java/software/amazon/smithy/cli/IntegUtils.java @@ -50,7 +50,8 @@ public static void run( String projectName, List args, Map env, - Consumer consumer) { + Consumer consumer + ) { withProject(projectName, path -> consumer.accept(run(path, args, env))); } @@ -58,7 +59,8 @@ public static void runWithEmptyCache( String projectName, List args, Map env, - Consumer consumer) { + Consumer consumer + ) { try { String cacheDir = Files.createTempDirectory("foo").toString(); Map actualEnv = new HashMap<>(env); diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/BuildParameterBuilder.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/BuildParameterBuilder.java index bd22643d638..6a115a4e5e6 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/BuildParameterBuilder.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/BuildParameterBuilder.java @@ -425,7 +425,8 @@ private Result( BuildParameterBuilder builder, String discoveryClasspath, String classpath, - Set sources) { + Set sources + ) { this.classpath = classpath; this.sources = new LinkedHashSet<>(sources); diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java index 647c5b0f60b..093e8b94cce 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ClasspathAction.java @@ -63,7 +63,8 @@ private void runTaskWithClasspath( BuildOptions buildOptions, SmithyBuildConfig smithyBuildConfig, Command.Env env, - Consumer consumer) { + Consumer consumer + ) { Set dependencies = smithyBuildConfig.getMaven() .map(MavenConfig::getDependencies) .orElse(Collections.emptySet()); @@ -118,7 +119,8 @@ private List resolveDependencies( BuildOptions buildOptions, SmithyBuildConfig smithyBuildConfig, Command.Env env, - MavenConfig maven) { + MavenConfig maven + ) { DependencyResolver baseResolver = dependencyResolverFactory.create(smithyBuildConfig, env); long lastModified = smithyBuildConfig.getLastModifiedInMillis(); DependencyResolver delegate = new FilterCliVersionResolver(SmithyCli.getVersion(), baseResolver); diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/HelpActionWrapper.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/HelpActionWrapper.java index 5e644dd772a..9ec1a5b080e 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/HelpActionWrapper.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/HelpActionWrapper.java @@ -32,7 +32,8 @@ final class HelpActionWrapper implements CommandAction { String parentCommandName, String summary, Function documentationProvider, - CommandAction delegate) { + CommandAction delegate + ) { this.name = name; this.parentCommandName = parentCommandName; this.summary = summary; @@ -48,7 +49,8 @@ static HelpActionWrapper fromCommand( Command command, String parentCommandName, Function documentationProvider, - CommandAction delegate) { + CommandAction delegate + ) { return new HelpActionWrapper( command.getName(), parentCommandName, diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/InitCommand.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/InitCommand.java index 19b67981a3b..107be51a5c7 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/InitCommand.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/InitCommand.java @@ -235,7 +235,8 @@ private void cloneTemplate( ObjectNode smithyTemplatesNode, Options options, StandardOptions standardOptions, - Env env) { + Env env + ) { String template = options.template; String directory = options.directory; @@ -353,7 +354,8 @@ private static void copyIncludedFiles( String dest, List includedFiles, String templateName, - Env env) { + Env env + ) { for (String included : includedFiles) { Path includedPath = Paths.get(temp, included); if (!Files.exists(includedPath)) { diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ModelBuilder.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ModelBuilder.java index 81b76e7f812..5198c26814e 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ModelBuilder.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/ModelBuilder.java @@ -218,7 +218,8 @@ static Consumer createStatusUpdater( StandardOptions standardOptions, ColorFormatter colors, CliPrinter stderr, - AtomicInteger issueCount) { + AtomicInteger issueCount + ) { // Only show the status if not quiet and the terminal supports ANSI. if (standardOptions.quiet() || !colors.isColorEnabled()) { return null; diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/WarmupCommand.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/WarmupCommand.java index dd51eb134d9..8c0c5e3b1ba 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/WarmupCommand.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/commands/WarmupCommand.java @@ -182,7 +182,8 @@ private void callJava( CliPrinter printer, Path baseDir, List baseArgs, - String... args) { + String... args + ) { List resolved = new ArrayList<>(baseArgs); Collections.addAll(resolved, args); diff --git a/smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/ResolvedArtifact.java b/smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/ResolvedArtifact.java index aa944f2b083..9725d5399bc 100644 --- a/smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/ResolvedArtifact.java +++ b/smithy-cli/src/main/java/software/amazon/smithy/cli/dependencies/ResolvedArtifact.java @@ -40,7 +40,8 @@ private ResolvedArtifact( String groupId, String artifactId, String version, - String shaSum) { + String shaSum + ) { this.coordinates = Objects.requireNonNull(coordinates); this.path = Objects.requireNonNull(path); this.groupId = groupId; diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SymbolDependency.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SymbolDependency.java index 6ca6061c779..62409cd0ecd 100644 --- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SymbolDependency.java +++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/SymbolDependency.java @@ -93,7 +93,8 @@ public static Builder builder() { * @throws CodegenException when two package versions conflict. */ public static Map> gatherDependencies( - Stream symbolStream) { + Stream symbolStream + ) { return gatherDependencies(symbolStream, (a, b) -> { throw new CodegenException(String.format( "Found a conflicting `%s` dependency for `%s`: `%s` conflicts with `%s`", @@ -129,7 +130,8 @@ public static Map> gatherDependencies( */ public static Map> gatherDependencies( Stream symbolStream, - BinaryOperator versionMergeFunction) { + BinaryOperator versionMergeFunction + ) { return symbolStream .sorted() .collect(Collectors.groupingBy( diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/TopologicalIndex.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/TopologicalIndex.java index a102326417c..072c8af2f03 100644 --- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/TopologicalIndex.java +++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/TopologicalIndex.java @@ -82,7 +82,8 @@ private Set explore( Shape shape, List path, Set visited, - NeighborProvider provider) { + NeighborProvider provider + ) { if (visited.contains(shape)) { return Collections.singleton(new PathFinder.Path(path)); } diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CreateContextDirective.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CreateContextDirective.java index d9476f5a136..564ad0a30ed 100644 --- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CreateContextDirective.java +++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/directed/CreateContextDirective.java @@ -37,7 +37,8 @@ public final class CreateContextDirective integrations) { + List integrations + ) { super(model, settings, service); this.symbolProvider = symbolProvider; this.fileManifest = fileManifest; diff --git a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/writer/CodegenWriterDelegator.java b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/writer/CodegenWriterDelegator.java index 2d434a034c4..9ab540dffce 100644 --- a/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/writer/CodegenWriterDelegator.java +++ b/smithy-codegen-core/src/main/java/software/amazon/smithy/codegen/core/writer/CodegenWriterDelegator.java @@ -73,7 +73,8 @@ public class CodegenWriterDelegator> { public CodegenWriterDelegator( FileManifest fileManifest, SymbolProvider symbolProvider, - CodegenWriterFactory codegenWriterFactory) { + CodegenWriterFactory codegenWriterFactory + ) { this.fileManifest = fileManifest; this.symbolProvider = symbolProvider; this.codegenWriterFactory = codegenWriterFactory; diff --git a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/TestContext.java b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/TestContext.java index 531063b5572..da47314e26b 100644 --- a/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/TestContext.java +++ b/smithy-codegen-core/src/test/java/software/amazon/smithy/codegen/core/directed/TestContext.java @@ -48,7 +48,8 @@ static TestContext create(String modelFile, ShapeId serviceId) { SymbolProvider symbolProvider, FileManifest fileManifest, WriterDelegator delegator, - ServiceShape service) { + ServiceShape service + ) { this.model = model; this.settings = settings; this.symbolProvider = symbolProvider; diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/ModelDiff.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/ModelDiff.java index 8d79609b3d4..bc3c82696a6 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/ModelDiff.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/ModelDiff.java @@ -82,7 +82,8 @@ public Result( Differences differences, List diffEvents, List oldModelEvents, - List newModelEvents) { + List newModelEvents + ) { this.differences = Objects.requireNonNull(differences); this.diffEvents = Objects.requireNonNull(diffEvents); this.oldModelEvents = Objects.requireNonNull(oldModelEvents); diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedDefault.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedDefault.java index 2ad42245e39..f57268365cf 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedDefault.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedDefault.java @@ -49,7 +49,8 @@ private void validateChange( Model model, ChangedShape change, DefaultTrait oldTrait, - DefaultTrait newTrait) { + DefaultTrait newTrait + ) { if (newTrait == null) { if (!isInconsequentialRemovalOfDefaultTrait(model, oldTrait, change.getNewShape())) { events.add(error(change.getNewShape(), @@ -107,7 +108,8 @@ private void evaluateChangedTrait( MemberShape member, DefaultTrait oldTrait, DefaultTrait newTrait, - List events) { + List events + ) { Shape target = model.expectShape(member.getTarget()); Node oldValue = oldTrait.toNode(); Node newValue = newTrait.toNode(); diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedMemberTarget.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedMemberTarget.java index 7d3d04f6b2d..ae45831d8ee 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedMemberTarget.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedMemberTarget.java @@ -134,7 +134,8 @@ private static void evaluateMember( ShapeType oldShapeType, List results, MemberShape oldMember, - MemberShape newMember) { + MemberShape newMember + ) { String memberSlug = oldShapeType == ShapeType.MAP ? oldMember.getMemberName() + " " : ""; if (!oldMember.getTarget().equals(newMember.getTarget())) { results.add(String.format("Both the old and new shapes are a %s, but the old shape %stargeted " diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedNullability.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedNullability.java index cae74e184cd..31564dc779b 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedNullability.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ChangedNullability.java @@ -76,7 +76,8 @@ private void createErrors( Differences differences, ChangedShape change, boolean wasNullable, - Collection events) { + Collection events + ) { MemberShape oldMember = change.getOldShape(); MemberShape newMember = change.getNewShape(); String message = String.format("Member `%s` changed from %s to %s: ", @@ -183,7 +184,8 @@ private ValidationEvent emit( ShapeId shape, SourceLocation sourceLocation, String prefixMessage, - String message) { + String message + ) { String actualId = eventIdSuffix == null ? getEventId() : (getEventId() + '.' + eventIdSuffix); String actualMessage = prefixMessage == null ? message : (prefixMessage + "; " + message); return ValidationEvent.builder() diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ModifiedTrait.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ModifiedTrait.java index 6fe20de17e8..11634900dfa 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ModifiedTrait.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/ModifiedTrait.java @@ -214,7 +214,8 @@ List validate( ShapeId trait, Node left, Node right, - Severity severity) { + Severity severity + ) { if (left != null) { return Collections.emptyList(); } @@ -249,7 +250,8 @@ List validate( ShapeId trait, Node left, Node right, - Severity severity) { + Severity severity + ) { if (right != null) { return Collections.emptyList(); } @@ -284,7 +286,8 @@ List validate( ShapeId trait, Node left, Node right, - Severity severity) { + Severity severity + ) { if (left == null || right == null || Objects.equals(left, right)) { return Collections.emptyList(); } @@ -320,7 +323,8 @@ List validate( ShapeId trait, Node left, Node right, - Severity severity) { + Severity severity + ) { List events = new ArrayList<>(); events.addAll(ADD.validate(model, path, shape, trait, left, right, severity)); events.addAll(REMOVE.validate(model, path, shape, trait, left, right, severity)); @@ -338,7 +342,8 @@ List validate( ShapeId trait, Node left, Node right, - Severity severity) { + Severity severity + ) { // The trait needs to exist in both models to perform this check. if (left == null || right == null) { return Collections.emptyList(); @@ -365,7 +370,8 @@ abstract List validate( ShapeId trait, Node left, Node right, - Severity severity); + Severity severity + ); private static String getValidationEventId(DiffType diffType, ShapeId trait) { return String.format("%s.%s.%s", @@ -383,7 +389,8 @@ private static void crawlContents( Node leftValue, Node rightValue, List events, - String path) { + String path + ) { currentTraitShape.accept(new DiffCrawler(model, startingShape, trait, leftValue, rightValue, events, path)); } @@ -404,7 +411,8 @@ private static final class DiffCrawler extends ShapeVisitor.Default { Node leftValue, Node rightValue, List events, - String path) { + String path + ) { this.model = model; this.startingShape = startingShape; this.trait = trait; diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/TraitBreakingChange.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/TraitBreakingChange.java index d6ec8afa2c3..40d05762183 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/TraitBreakingChange.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/evaluators/TraitBreakingChange.java @@ -78,7 +78,8 @@ private static final class PathChecker { Shape trait, Shape targetShape, TraitDefinition.BreakingChangeRule rule, - List events) { + List events + ) { this.model = model; this.trait = trait; this.targetShape = targetShape; @@ -117,7 +118,8 @@ private void extract( Shape currentShape, int segmentPosition, Node currentValue, - String path) { + String path + ) { // Don't keep crawling when a "" segment is hit or the last segment is hit. if (segmentPosition >= segements.size() || segements.get(segmentPosition).isEmpty()) { result.put(path, currentValue); diff --git a/smithy-diff/src/main/java/software/amazon/smithy/diff/testrunner/SmithyDiffTestCase.java b/smithy-diff/src/main/java/software/amazon/smithy/diff/testrunner/SmithyDiffTestCase.java index bf803628912..99ee30c1f69 100644 --- a/smithy-diff/src/main/java/software/amazon/smithy/diff/testrunner/SmithyDiffTestCase.java +++ b/smithy-diff/src/main/java/software/amazon/smithy/diff/testrunner/SmithyDiffTestCase.java @@ -48,7 +48,8 @@ public final class SmithyDiffTestCase { public SmithyDiffTestCase( Path path, String name, - List expectedEvents) { + List expectedEvents + ) { this.path = Objects.requireNonNull(path); this.name = Objects.requireNonNull(name); this.expectedEvents = Collections.unmodifiableList(expectedEvents); @@ -200,7 +201,8 @@ public static final class Result { Result( String name, Collection unmatchedEvents, - Collection extraEvents) { + Collection extraEvents + ) { this.name = name; this.unmatchedEvents = Collections.unmodifiableCollection(new TreeSet<>(unmatchedEvents)); this.extraEvents = Collections.unmodifiableCollection(new TreeSet<>(extraEvents)); diff --git a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/ModifiedTraitTest.java b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/ModifiedTraitTest.java index fe540f0957a..d40f2077b6c 100644 --- a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/ModifiedTraitTest.java +++ b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/ModifiedTraitTest.java @@ -91,7 +91,8 @@ public void testWithoutDefinition( String newValue, String diffType, String tag, - String searchString) { + String searchString + ) { TestCaseData data = new TestCaseData(oldValue, newValue); Model modelA = Model.assembler().addShape(data.oldShape).assemble().unwrap(); diff --git a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/TraitBreakingChangeTest.java b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/TraitBreakingChangeTest.java index 6927585f5d5..cf82879355d 100644 --- a/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/TraitBreakingChangeTest.java +++ b/smithy-diff/src/test/java/software/amazon/smithy/diff/evaluators/TraitBreakingChangeTest.java @@ -43,7 +43,8 @@ public void detectsBreakingChangeWhenRemoved() { private void validate( String modelFile, Function mapper, - Consumer> consumer) { + Consumer> consumer + ) { Model modelA = Model.assembler() .addImport(getClass().getResource("trait-breaking-change/" + modelFile)) .assemble() diff --git a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/RuntimeType.java b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/RuntimeType.java index dfeb0ebb091..d57a3e8ec02 100644 --- a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/RuntimeType.java +++ b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/RuntimeType.java @@ -148,5 +148,6 @@ public String toString() { public abstract LiteralExpression compare( LiteralExpression left, LiteralExpression right, - ComparatorType comparator); + ComparatorType comparator + ); } diff --git a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/ComparatorExpression.java b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/ComparatorExpression.java index 92dbdd8b881..98239749f7b 100644 --- a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/ComparatorExpression.java +++ b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/ComparatorExpression.java @@ -27,7 +27,8 @@ public ComparatorExpression( JmespathExpression left, JmespathExpression right, int line, - int column) { + int column + ) { super(left, right, line, column); this.comparator = comparator; } diff --git a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/FilterProjectionExpression.java b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/FilterProjectionExpression.java index 2b9aa113bee..964271c35c4 100644 --- a/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/FilterProjectionExpression.java +++ b/smithy-jmespath/src/main/java/software/amazon/smithy/jmespath/ast/FilterProjectionExpression.java @@ -29,7 +29,8 @@ public final class FilterProjectionExpression extends BinaryExpression { public FilterProjectionExpression( JmespathExpression left, JmespathExpression comparison, - JmespathExpression right) { + JmespathExpression right + ) { this(left, comparison, right, 1, 1); } @@ -38,7 +39,8 @@ public FilterProjectionExpression( JmespathExpression comparison, JmespathExpression right, int line, - int column) { + int column + ) { super(left, right, line, column); this.comparison = comparison; } diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaConverter.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaConverter.java index 87ba1ccaaac..8b6b360d116 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaConverter.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaConverter.java @@ -113,7 +113,8 @@ private JsonSchemaConverter(Builder builder) { private static Model createUpdatedModel( Model model, Shape rootShape, - Predicate predicate) { + Predicate predicate + ) { ModelTransformer transformer = ModelTransformer.create(); if (rootShape != null) { diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java index fffc6390c44..3c13e02cfdd 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/JsonSchemaMapperContext.java @@ -18,7 +18,8 @@ public class JsonSchemaMapperContext { JsonSchemaMapperContext( Model model, Shape shape, - JsonSchemaConfig config) { + JsonSchemaConfig config + ) { this.model = model; this.shape = shape; this.config = config; diff --git a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/RefStrategy.java b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/RefStrategy.java index 456e3f49945..54531a7dcc1 100644 --- a/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/RefStrategy.java +++ b/smithy-jsonschema/src/main/java/software/amazon/smithy/jsonschema/RefStrategy.java @@ -67,7 +67,8 @@ static RefStrategy createDefaultStrategy( Model model, JsonSchemaConfig config, PropertyNamingStrategy propertyNamingStrategy, - Predicate shapePredicate) { + Predicate shapePredicate + ) { RefStrategy delegate = new DefaultRefStrategy(model, config, propertyNamingStrategy); return new DeconflictingStrategy(model, delegate, shapePredicate); } diff --git a/smithy-linters/src/main/java/software/amazon/smithy/linters/InputOutputStructureReuseValidator.java b/smithy-linters/src/main/java/software/amazon/smithy/linters/InputOutputStructureReuseValidator.java index a58ee4d71f2..8c1f4571393 100644 --- a/smithy-linters/src/main/java/software/amazon/smithy/linters/InputOutputStructureReuseValidator.java +++ b/smithy-linters/src/main/java/software/amazon/smithy/linters/InputOutputStructureReuseValidator.java @@ -47,7 +47,8 @@ private void validateInputOutputSet( OperationShape operation, StructureShape input, StructureShape output, - List events) { + List events + ) { if (!input.hasTrait(InputTrait.class)) { events.add(warning(input, String.format( diff --git a/smithy-linters/src/main/java/software/amazon/smithy/linters/MissingPaginatedTraitValidator.java b/smithy-linters/src/main/java/software/amazon/smithy/linters/MissingPaginatedTraitValidator.java index 2889341e9db..566602fa5ff 100644 --- a/smithy-linters/src/main/java/software/amazon/smithy/linters/MissingPaginatedTraitValidator.java +++ b/smithy-linters/src/main/java/software/amazon/smithy/linters/MissingPaginatedTraitValidator.java @@ -176,7 +176,8 @@ public List validate(Model model) { private Stream validateShape( Model model, OperationIndex operationIndex, - OperationShape operation) { + OperationShape operation + ) { List words = ValidationUtils.splitCamelCaseWord(operation.getId().getName()); String verb = words.get(0).toLowerCase(Locale.US); @@ -218,7 +219,8 @@ private Stream suggestPagination( String verb, OperationShape operation, StructureShape output, - Model model) { + Model model + ) { if (!config.getVerbsSuggestPagination().contains(verb)) { return Stream.empty(); } diff --git a/smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java b/smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java index 318dc7f2962..6adfa13c243 100644 --- a/smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java +++ b/smithy-linters/src/main/java/software/amazon/smithy/linters/NoninclusiveTermsValidator.java @@ -136,7 +136,8 @@ private Collection getValidationEvents(TextInstance instance) { private ValidationEvent constructValidationEvent( TextInstance instance, List replacements, - String matchedText) { + String matchedText + ) { String replacementAddendum = getReplacementAddendum(matchedText, replacements); switch (instance.getLocationType()) { case NAMESPACE: diff --git a/smithy-linters/src/main/java/software/amazon/smithy/linters/ShouldHaveUsedTimestampValidator.java b/smithy-linters/src/main/java/software/amazon/smithy/linters/ShouldHaveUsedTimestampValidator.java index 71d71165963..d62f6183e08 100644 --- a/smithy-linters/src/main/java/software/amazon/smithy/linters/ShouldHaveUsedTimestampValidator.java +++ b/smithy-linters/src/main/java/software/amazon/smithy/linters/ShouldHaveUsedTimestampValidator.java @@ -129,7 +129,8 @@ public List enumShape(EnumShape shape) { private List validateStructure( StructureShape structure, - Model model) { + Model model + ) { return structure .getAllMembers() .entrySet() @@ -140,7 +141,8 @@ private List validateStructure( private List validateUnion( UnionShape union, - Model model) { + Model model + ) { return union .getAllMembers() .entrySet() @@ -152,13 +154,15 @@ private List validateUnion( private Stream validateTargetShape( String name, MemberShape memberShape, - Model model) { + Model model + ) { return OptionalUtils.stream(model.getShape(memberShape.getTarget()) .flatMap(targetShape -> validateName(name, targetShape, memberShape, patterns, model))); } private List validateSimpleShape( - Shape shape) { + Shape shape + ) { String name = shape.getId().getName(); return patterns @@ -173,7 +177,8 @@ private Optional validateName( Shape targetShape, Shape context, List patterns, - Model model) { + Model model + ) { ShapeType type = targetShape.getType(); if (type == ShapeType.TIMESTAMP || type == ShapeType.ENUM) { return Optional.empty(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java index 42f60638eb7..9ef447c5cba 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/BottomUpIndex.java @@ -44,7 +44,8 @@ private void collectPaths( Map> paths, Deque path, Shape current, - NeighborProvider neighborProvider) { + NeighborProvider neighborProvider + ) { for (Relationship relationship : neighborProvider.getNeighbors(current)) { Shape neighbor = relationship.expectNeighborShape(); if (!neighbor.isOperationShape() && !neighbor.isResourceShape()) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamIndex.java index 2ab231c02dd..4661b7d318e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamIndex.java @@ -48,7 +48,8 @@ private void computeEvents( Model model, OperationShape operation, StructureShape shape, - Map infoMap) { + Map infoMap + ) { for (MemberShape member : shape.getAllMembers().values()) { Shape target = model.expectShape(member.getTarget()); if (target.hasTrait(StreamingTrait.class) && target.isUnionShape()) { @@ -93,7 +94,8 @@ private Optional createEventStreamInfo( Model model, OperationShape operation, StructureShape structure, - MemberShape member) { + MemberShape member + ) { Shape eventStreamTarget = model.expectShape(member.getTarget()); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamInfo.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamInfo.java index 25641a5d165..d51168548c5 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamInfo.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/EventStreamInfo.java @@ -34,7 +34,8 @@ public final class EventStreamInfo { Shape eventStreamTarget, Map initialMembers, Map initialTargets, - Map events) { + Map events + ) { this.operation = operation; this.streamingTrait = streamingTrait; this.structure = structure; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java index 626834ec725..6d566dc164d 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/HttpBindingIndex.java @@ -212,7 +212,8 @@ public List getResponseBindings(ToShapeId shapeOrId, HttpBinding.Lo public TimestampFormatTrait.Format determineTimestampFormat( ToShapeId member, HttpBinding.Location location, - TimestampFormatTrait.Format defaultFormat) { + TimestampFormatTrait.Format defaultFormat + ) { Model model = getModel(); return model.getShape(member.toShapeId()) // Use the timestampFormat trait on the member or target if present. @@ -278,7 +279,8 @@ public Optional determineRequestContentType(ToShapeId operation, String public Optional determineRequestContentType( ToShapeId operation, String documentContentType, - String eventStreamContentType) { + String eventStreamContentType + ) { Collection bindings = getRequestBindings(operation).values(); return Optional.ofNullable(determineContentType(bindings, documentContentType, eventStreamContentType)); } @@ -330,7 +332,8 @@ public Optional determineResponseContentType(ToShapeId operationOrError, public Optional determineResponseContentType( ToShapeId operationOrError, String documentContentType, - String eventStreamContentType) { + String eventStreamContentType + ) { Collection bindings = getResponseBindings(operationOrError).values(); return Optional.ofNullable(determineContentType(bindings, documentContentType, eventStreamContentType)); } @@ -338,7 +341,8 @@ public Optional determineResponseContentType( private String determineContentType( Collection bindings, String documentContentType, - String eventStreamContentType) { + String eventStreamContentType + ) { Model model = getModel(); for (HttpBinding binding : bindings) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginatedIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginatedIndex.java index 07864d05109..25168d3206c 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginatedIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginatedIndex.java @@ -62,7 +62,8 @@ private Optional create( ServiceShape service, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait) { + PaginatedTrait trait + ) { StructureShape input = opIndex.expectInputShape(operation.getId()); StructureShape output = opIndex.expectOutputShape(operation.getId()); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginationInfo.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginationInfo.java index 853f3078149..477944a8e0f 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginationInfo.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/PaginationInfo.java @@ -36,7 +36,8 @@ public final class PaginationInfo { MemberShape inputToken, List outputToken, MemberShape pageSize, - List items) { + List items + ) { this.service = service; this.operation = operation; this.input = input; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/ServiceIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/ServiceIndex.java index ef5c288be99..061a9749108 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/ServiceIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/ServiceIndex.java @@ -260,7 +260,8 @@ public Map getEffectiveAuthSchemes(ToShapeId service, ToShapeId public Map getEffectiveAuthSchemes( ToShapeId service, ToShapeId operation, - AuthSchemeMode authSchemeMode) { + AuthSchemeMode authSchemeMode + ) { Map authSchemes = getEffectiveAuthSchemes(service, operation); if (authSchemeMode == AuthSchemeMode.NO_AUTH_AWARE) { if (authSchemes.isEmpty() || hasOptionalAuth(operation)) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java index 1a9d8239bb8..ac280298afa 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextIndex.java @@ -59,7 +59,8 @@ public Collection getTextInstances() { private static void computeShapeTextInstances( Shape shape, Collection textInstances, - Model model) { + Model model + ) { textInstances.add(TextInstance.createShapeInstance(shape)); for (Trait trait : shape.getAllTraits().values()) { @@ -82,7 +83,8 @@ private static void computeTextInstancesForAppliedTrait( Collection textInstances, Deque propertyPath, Model model, - Shape currentTraitPropertyShape) { + Shape currentTraitPropertyShape + ) { if (trait.toShapeId().equals(ReferencesTrait.ID)) { //Skip ReferenceTrait because it is referring to other shape names already being checked } else if (node.isStringNode()) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java index 10277c801cf..1fa81a0d390 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/knowledge/TextInstance.java @@ -27,7 +27,8 @@ private TextInstance( final String text, final Shape shape, final Trait trait, - final Deque traitPropertyPath) { + final Deque traitPropertyPath + ) { this.locationType = locationType; this.text = text; this.shape = shape; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyMixin.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyMixin.java index 2795cd6f12d..4748d05817d 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyMixin.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyMixin.java @@ -39,7 +39,8 @@ public void modifyMember( AbstractShapeBuilder shapeBuilder, MemberShape.Builder memberBuilder, Function> unclaimedTraits, - Function shapeMap) { + Function shapeMap + ) { // The target could have been set by resource based properties. if (memberBuilder.getTarget() != null) { return; @@ -61,7 +62,8 @@ public void modifyShape( AbstractShapeBuilder builder, Map memberBuilders, Function> unclaimedTraits, - Function shapeMap) { + Function shapeMap + ) { Shape mixinShape = shapeMap.apply(mixin); if (mixinShape == null) { throw new SourceException("Cannot apply mixin to " + builder.getId() + ": " + mixin + " not found", diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyResourceBasedTargets.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyResourceBasedTargets.java index f1dd337a1ca..ceba5a27660 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyResourceBasedTargets.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ApplyResourceBasedTargets.java @@ -40,7 +40,8 @@ public void modifyMember( AbstractShapeBuilder shapeBuilder, MemberShape.Builder memberBuilder, Function> unclaimedTraits, - Function shapeMap) { + Function shapeMap + ) { // Fast-fail the common case of the target having already been set. if (memberBuilder.getTarget() != null) { return; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/AstModelLoader.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/AstModelLoader.java index 099f97cd20b..f80dee70f42 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/AstModelLoader.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/AstModelLoader.java @@ -249,7 +249,8 @@ private void loadOptionalMember(LoadOperation.DefineShape operation, ShapeId id, private LoadOperation.DefineShape loadCollection( ShapeId id, ObjectNode node, - CollectionShape.Builder builder) { + CollectionShape.Builder builder + ) { LoaderUtils.checkForAdditionalProperties(node, id, COLLECTION_PROPERTY_NAMES).ifPresent(this::emit); applyShapeTraits(id, node); // Add the container before members to ensure sets are rejected before adding unreferenced members. @@ -362,7 +363,8 @@ static void loadServiceRenameIntoBuilder(ServiceShape.Builder builder, ObjectNod private LoadOperation.DefineShape loadSimpleShape( ShapeId id, ObjectNode node, - AbstractShapeBuilder builder) { + AbstractShapeBuilder builder + ) { LoaderUtils.checkForAdditionalProperties(node, id, SIMPLE_PROPERTY_NAMES).ifPresent(this::emit); applyShapeTraits(id, node); builder.id(id).source(node.getSourceLocation()); @@ -374,7 +376,8 @@ private LoadOperation.DefineShape loadSimpleShape( private LoadOperation.DefineShape loadNamedMemberShape( ShapeId id, ObjectNode node, - AbstractShapeBuilder builder) { + AbstractShapeBuilder builder + ) { LoaderUtils.checkForAdditionalProperties(node, id, NAMED_MEMBER_SHAPE_PROPERTY_NAMES).ifPresent(this::emit); builder.id(id).source(node.getSourceLocation()); LoadOperation.DefineShape operation = createShape(builder); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlModelLoader.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlModelLoader.java index 5a70f97a737..74ace184a43 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlModelLoader.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlModelLoader.java @@ -985,7 +985,8 @@ private void parseInlineableOperationMember( IdlToken token, String suffix, Consumer consumer, - IdlTraitParser.Result defaultTrait) { + IdlTraitParser.Result defaultTrait + ) { if (token == IdlToken.WALRUS) { if (!modelVersion.supportsInlineOperationIO()) { throw syntax(id, diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlNodeParser.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlNodeParser.java index fe0e6322f05..3972b4ba087 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlNodeParser.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/IdlNodeParser.java @@ -134,7 +134,8 @@ static Keyword from(String keyword) { private static Node createSyntacticShapeId( IdlModelLoader loader, String identifier, - SourceLocation location) { + SourceLocation location + ) { // Unquoted node values syntactically are assumed to be references to shapes. A lazy string node is // used because the shape ID may not be able to be resolved until after the entire model is loaded. Pair> pair = StringNode.createLazyString(identifier, location); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperation.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperation.java index 84762b3647c..44d2f4c1ee2 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperation.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperation.java @@ -81,7 +81,8 @@ static final class ApplyTrait extends LoadOperation { String namespace, ShapeId target, ShapeId trait, - Node value) { + Node value + ) { super(version); this.namespace = namespace; this.target = target; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperationProcessor.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperationProcessor.java index 9bb6126365e..6574e49a3ea 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperationProcessor.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoadOperationProcessor.java @@ -38,7 +38,8 @@ final class LoadOperationProcessor implements Consumer { Model prelude, boolean allowUnknownTraits, Consumer validationEventListener, - ValidationEventDecorator decorator) { + ValidationEventDecorator decorator + ) { // Emit events as the come in. this.events = new ArrayList() { @Override diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderShapeMap.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderShapeMap.java index f699d5b548c..f57743f8ac7 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderShapeMap.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderShapeMap.java @@ -160,7 +160,8 @@ void moveCreatedShapeToOperations(ShapeId shapeId, Consumer proce void buildShapesAndClaimMixinTraits( Model.Builder modelBuilder, - Function> unclaimedTraits) { + Function> unclaimedTraits + ) { Function createdShapeMap = id -> modelBuilder.getCurrentShapes().get(id); for (Shape shape : createdShapes.values()) { @@ -179,7 +180,8 @@ private void buildIntoModel( ShapeWrapper wrapper, Model.Builder builder, Function> unclaimedTraits, - Function createdShapeMap) { + Function createdShapeMap + ) { Shape built = null; for (LoadOperation.DefineShape shape : wrapper) { if (validateShapeVersion(shape)) { @@ -263,7 +265,8 @@ private boolean anyMissingTransitiveDependencies( ShapeId current, List resolved, Set unresolved, - Set visited) { + Set visited + ) { if (resolved.contains(current)) { return false; } else if (!unresolved.contains(current)) { @@ -353,7 +356,8 @@ private boolean validateConflicts(ShapeId id, Shape built, Shape previous) { private Shape buildShape( LoadOperation.DefineShape defineShape, Function> traitClaimer, - Function createdShapeMap) { + Function createdShapeMap + ) { try { AbstractShapeBuilder builder = defineShape.builder(); ModelInteropTransformer.patchShapeBeforeBuilding(defineShape, builder, events); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderTraitMap.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderTraitMap.java index 2cb579d04b2..5a907b4a28e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderTraitMap.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderTraitMap.java @@ -129,7 +129,8 @@ private void validateTraitIsKnown( ShapeId traitId, Trait trait, SourceLocation sourceLocation, - LoaderShapeMap shapeMap) { + LoaderShapeMap shapeMap + ) { if (!shapeMap.isRootShapeDefined(traitId) && (trait == null || !trait.isSynthetic())) { Severity severity = allowUnknownTraits ? Severity.WARNING : Severity.ERROR; events.add(ValidationEvent.builder() diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderUtils.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderUtils.java index 4d8e1d68e5f..d9957e22e2c 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderUtils.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/LoaderUtils.java @@ -35,7 +35,8 @@ private LoaderUtils() {} static Optional checkForAdditionalProperties( ObjectNode node, ShapeId shape, - Collection properties) { + Collection properties + ) { try { node.expectNoAdditionalProperties(properties); return Optional.empty(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelInteropTransformer.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelInteropTransformer.java index a9a2338e0a7..675283e354a 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelInteropTransformer.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelInteropTransformer.java @@ -182,7 +182,8 @@ private boolean memberDoesNotHaveDefaultZeroValueTrait(MemberShape member, Shape static void patchShapeBeforeBuilding( LoadOperation.DefineShape defineShape, AbstractShapeBuilder builder, - List events) { + List events + ) { handleBoxing(defineShape, builder); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelLoader.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelLoader.java index eed172a08c2..9147669c48e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelLoader.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelLoader.java @@ -53,7 +53,8 @@ static boolean load( String filename, Consumer operationConsumer, Supplier contentSupplier, - Function stringTable) { + Function stringTable + ) { try { if (filename.endsWith(".smithy")) { try (InputStream inputStream = contentSupplier.get()) { @@ -110,7 +111,8 @@ private static void loadJar( Map properties, String filename, Consumer operationConsumer, - Function stringTable) { + Function stringTable + ) { URL manifestUrl = ModelDiscovery.createSmithyJarManifestUrl(filename); LOGGER.fine(() -> "Loading Smithy model imports from JAR: " + manifestUrl); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java index 75d998939a4..c1253e56dbd 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ModelValidator.java @@ -147,7 +147,8 @@ public Builder addValidator(Validator validator) { */ public Builder validatorFactory( ValidatorFactory validatorFactory, - ValidationEventDecorator validationEventDecorator) { + ValidationEventDecorator validationEventDecorator + ) { this.validatorFactory = Objects.requireNonNull(validatorFactory); this.validationEventDecorator = validationEventDecorator; return this; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ShapeModifier.java b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ShapeModifier.java index 47e6ba58aec..66cc1a97572 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/loader/ShapeModifier.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/loader/ShapeModifier.java @@ -32,7 +32,8 @@ default void modifyMember( AbstractShapeBuilder shapeBuilder, MemberShape.Builder memberBuilder, Function> unclaimedTraits, - Function shapeMap) {} + Function shapeMap + ) {} /** * Modify the pending shape after its local members have been built. @@ -48,7 +49,8 @@ default void modifyShape( AbstractShapeBuilder builder, Map memberBuilders, Function> unclaimedTraits, - Function shapeMap) {} + Function shapeMap + ) {} /** * @return Returns any events emitted by the modifier. diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/neighbor/Relationship.java b/smithy-model/src/main/java/software/amazon/smithy/model/neighbor/Relationship.java index 915e06c29c2..a3c316241fd 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/neighbor/Relationship.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/neighbor/Relationship.java @@ -28,7 +28,8 @@ private Relationship( Shape shape, RelationshipType relationshipType, ShapeId neighborShapeId, - Shape neighborShape) { + Shape neighborShape + ) { this.shape = Objects.requireNonNull(shape); this.relationshipType = Objects.requireNonNull(relationshipType); this.neighborShapeId = Objects.requireNonNull(neighborShapeId); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeDeserializers.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeDeserializers.java index b6c02c2a02d..e204d712f71 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeDeserializers.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/DefaultNodeDeserializers.java @@ -368,7 +368,8 @@ static void apply( Node node, Type target, String pointer, - NodeMapper mapper) throws ReflectiveOperationException { + NodeMapper mapper + ) throws ReflectiveOperationException { for (Map.Entry entry : node.expectObjectNode().getStringMap().entrySet()) { Method setter = findSetter(target, entry.getKey()); if (setter == null) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeDeserializationException.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeDeserializationException.java index d272ddb5f26..10a297bd315 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeDeserializationException.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeDeserializationException.java @@ -35,7 +35,8 @@ static NodeDeserializationException fromReflectiveContext( String pointer, Node node, ReflectiveOperationException previous, - String message) { + String message + ) { if (previous.getCause() instanceof NodeDeserializationException) { return (NodeDeserializationException) previous.getCause(); } else { @@ -58,7 +59,8 @@ static NodeDeserializationException fromContext( String pointer, Node node, Throwable previous, - String message) { + String message + ) { String formattedMessage = NodeMapper.createErrorMessage(into, pointer, node, message); return new NodeDeserializationException(formattedMessage, node.getSourceLocation(), previous); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeMapper.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeMapper.java index d86565bfa39..27e6eb551fb 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeMapper.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodeMapper.java @@ -469,7 +469,8 @@ public T deserializeInto(Node value, T objectToMutate) { public , U, V extends Collection> V deserializeCollection( Node value, Class into, - Class members) { + Class members + ) { ParameterizedType type = new ParameterizedType() { @Override public Type[] getActualTypeArguments() { @@ -509,7 +510,8 @@ public Type getOwnerType() { public , U, V extends Map> V deserializeMap( Node value, Class into, - Class members) { + Class members + ) { ParameterizedType type = new ParameterizedType() { @Override public Type[] getActualTypeArguments() { @@ -571,7 +573,8 @@ private static NodeDeserializationException createError( String pointer, Node node, String message, - Throwable cause) { + Throwable cause + ) { String errorMessage = createErrorMessage(into, pointer, node, message); return new NodeDeserializationException(errorMessage, node.getSourceLocation(), cause); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodePointer.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodePointer.java index 9227118c820..694ad71406e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/NodePointer.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/NodePointer.java @@ -239,7 +239,8 @@ private Node addObjectMember( ObjectNode container, Node value, int partPosition, - boolean intermediate) { + boolean intermediate + ) { if (isLast) { return container.withMember(part, value); } else if (container.getMember(part).isPresent()) { @@ -268,7 +269,8 @@ private Node addArrayMember( ArrayNode container, Node value, int partPosition, - boolean intermediate) { + boolean intermediate + ) { if (!isLast) { // "-" is a special case for the last element. int partInt = part.equals("-") ? container.size() - 1 : parseIntPart(part); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java index 695f72cec96..88272c7da02 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/ObjectNode.java @@ -722,7 +722,8 @@ public ObjectNode merge(ObjectNode other) { */ public static Collector, ObjectNode> collect( Function keyMapper, - Function valueMapper) { + Function valueMapper + ) { return Collector.of( LinkedHashMap::new, (results, entry) -> results.put(keyMapper.apply(entry), valueMapper.apply(entry).toNode()), @@ -744,7 +745,8 @@ public static Collector, ObjectNode> collect( */ public static Collector, ObjectNode> collectStringKeys( Function keyMapper, - Function valueMapper) { + Function valueMapper + ) { return collect(entry -> from(keyMapper.apply(entry)), valueMapper); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/node/StringNode.java b/smithy-model/src/main/java/software/amazon/smithy/model/node/StringNode.java index cf6a7748079..131c9f9fb5e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/node/StringNode.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/node/StringNode.java @@ -55,7 +55,8 @@ public StringNode(String value, SourceLocation sourceLocation) { @SmithyInternalApi public static Pair> createLazyString( String placeholder, - SourceLocation sourceLocation) { + SourceLocation sourceLocation + ) { StringNode result = new StringNode(placeholder, sourceLocation); return Pair.of(result, result::updateValue); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeComparator.java b/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeComparator.java index 0c3c16409c7..0624f030c06 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeComparator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeComparator.java @@ -138,7 +138,8 @@ static boolean subset(AttributeValue a, AttributeValue b, boolean caseInsensitiv static boolean isSubset( Collection aValues, Collection bValues, - boolean caseInsensitive) { + boolean caseInsensitive + ) { for (AttributeValue aValue : aValues) { boolean foundMatch = false; for (AttributeValue bValue : bValues) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeSelector.java b/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeSelector.java index 11c9775576a..64371d8bffa 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeSelector.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/selector/AttributeSelector.java @@ -29,7 +29,8 @@ final class AttributeSelector implements InternalSelector { List path, List expected, AttributeComparator comparator, - boolean caseInsensitive) { + boolean caseInsensitive + ) { this.path = path; this.caseInsensitive = caseInsensitive; this.comparator = comparator; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java b/smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java index 2d9a2b131d1..565028344a9 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/selector/PathFinder.java @@ -358,7 +358,8 @@ private static final class Search { NeighborProvider provider, Shape startingShape, Collection candidates, - Predicate filter) { + Predicate filter + ) { this.startingShape = startingShape; this.candidates = candidates; this.provider = provider; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/selector/ScopedAttributeSelector.java b/smithy-model/src/main/java/software/amazon/smithy/model/selector/ScopedAttributeSelector.java index 1f4fc4d29fb..ff11f1c7c80 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/selector/ScopedAttributeSelector.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/selector/ScopedAttributeSelector.java @@ -25,7 +25,8 @@ static final class Assertion { ScopedFactory lhs, AttributeComparator comparator, List rhs, - boolean caseInsensitive) { + boolean caseInsensitive + ) { this.lhs = lhs; this.comparator = comparator; this.rhs = rhs; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/selector/WrappedSelector.java b/smithy-model/src/main/java/software/amazon/smithy/model/selector/WrappedSelector.java index 764d468f4dd..2c8ee86ee26 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/selector/WrappedSelector.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/selector/WrappedSelector.java @@ -144,7 +144,8 @@ private Set evalRoot( Model model, NeighborProviderIndex index, InternalSelector selector, - List> results) { + List> results + ) { Collection shapesToEmit = selector.getStartingShapes(model); Context isolatedContext = new Context(model, index, results); Set captures = new HashSet<>(); @@ -162,7 +163,8 @@ private Set evalRoot( private void pushShapes( Model model, Collection startingShapes, - InternalSelector.Receiver acceptor) { + InternalSelector.Receiver acceptor + ) { Objects.requireNonNull(startingShapes); Context context = new Context(model, NeighborProviderIndex.of(model), computeRoots(model)); for (Shape shape : startingShapes) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java index 80455ea817a..2e770c5a6c0 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/EnumShape.java @@ -216,7 +216,8 @@ public static boolean canConvertToEnum(StringShape shape, boolean synthesizeEnum static Optional memberFromEnumDefinition( EnumDefinition definition, ShapeId parentId, - boolean synthesizeName) { + boolean synthesizeName + ) { String name; if (!definition.getName().isPresent()) { if (canConvertEnumDefinitionToMember(definition, synthesizeName)) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/NamedMemberUtils.java b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/NamedMemberUtils.java index 28bd46613c9..d277e23102a 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/NamedMemberUtils.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/NamedMemberUtils.java @@ -23,7 +23,8 @@ static Map computeMixinMembers( Map mixins, BuilderRef> members, ShapeId shapeId, - SourceLocation sourceLocation) { + SourceLocation sourceLocation + ) { if (mixins.isEmpty()) { return members.copy(); } @@ -87,7 +88,8 @@ static Set flattenMixins( Map members, Map mixins, ShapeId shapeId, - SourceLocation sourceLocation) { + SourceLocation sourceLocation + ) { // Ensure that the members are ordered, mixin members first, followed by local members. Map orderedMembers = new LinkedHashMap<>(); Map pendingMembers = new LinkedHashMap<>(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java index 9d180720e0a..7f0ee20809e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/shapes/SmithyIdlModelSerializer.java @@ -224,7 +224,8 @@ private Set getInlineableShapes( Model fullModel, Collection shapes, String inputSuffix, - String outputSuffix) { + String outputSuffix + ) { OperationIndex operationIndex = OperationIndex.of(fullModel); Set inlineableShapes = new HashSet<>(); for (Shape shape : shapes) { @@ -310,7 +311,8 @@ private String serializeHeader( Collection shapes, String inputSuffix, String outputSuffix, - boolean addMetadata) { + boolean addMetadata + ) { SmithyCodeWriter codeWriter = new SmithyCodeWriter(null, fullModel); codeWriter.write("$$version: \"$L\"", Model.MODEL_VERSION); @@ -562,7 +564,8 @@ private static final class ShapeSerializer extends ShapeVisitor.Default { Predicate traitFilter, Model model, Set inlineableShapes, - SmithyIdlComponentOrder componentOrder) { + SmithyIdlComponentOrder componentOrder + ) { this.codeWriter = codeWriter; this.nodeSerializer = nodeSerializer; this.traitFilter = traitFilter; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/traits/PaginatedTrait.java b/smithy-model/src/main/java/software/amazon/smithy/model/traits/PaginatedTrait.java index b7fe400a48f..2c376a8c7d3 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/traits/PaginatedTrait.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/traits/PaginatedTrait.java @@ -88,7 +88,8 @@ public Optional getPageSize() { public static Optional resolvePath( String path, Model model, - StructureShape shape) { + StructureShape shape + ) { List memberShapes = resolveFullPath(path, model, shape); if (memberShapes.size() == 0) { return Optional.empty(); @@ -112,7 +113,8 @@ public static Optional resolvePath( public static List resolveFullPath( String path, Model model, - StructureShape shape) { + StructureShape shape + ) { List memberShapes = new ArrayList<>(); // For each member name in the path, try to find that member in the previous structure diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/traits/Trait.java b/smithy-model/src/main/java/software/amazon/smithy/model/traits/Trait.java index d1617f4f3f6..f1cbd437e11 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/traits/Trait.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/traits/Trait.java @@ -83,7 +83,8 @@ default boolean isSynthetic() { @Deprecated static Stream> flatMapStream( S shape, - Class traitClass) { + Class traitClass + ) { return OptionalUtils.stream(shape.getTrait(traitClass).map(t -> Pair.of(shape, t))); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/transform/CreateDedicatedInputAndOutput.java b/smithy-model/src/main/java/software/amazon/smithy/model/transform/CreateDedicatedInputAndOutput.java index fa536701cfa..b894ec839ae 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/transform/CreateDedicatedInputAndOutput.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/transform/CreateDedicatedInputAndOutput.java @@ -97,7 +97,8 @@ private StructureShape createdUpdatedInput( Model model, OperationShape operation, StructureShape input, - NeighborProvider reverse) { + NeighborProvider reverse + ) { if (input.hasTrait(InputTrait.class)) { return renameShapeIfNeeded(model, input, operation, inputSuffix); } else if (isDedicatedHeuristic(operation, input, reverse)) { @@ -113,7 +114,8 @@ private StructureShape createdUpdatedOutput( Model model, OperationShape operation, StructureShape output, - NeighborProvider reverse) { + NeighborProvider reverse + ) { if (output.hasTrait(OutputTrait.class)) { return renameShapeIfNeeded(model, output, operation, outputSuffix); } else if (isDedicatedHeuristic(operation, output, reverse)) { @@ -129,7 +131,8 @@ private StructureShape renameShapeIfNeeded( Model model, StructureShape struct, OperationShape operation, - String suffix) { + String suffix + ) { // Check if the shape already has the desired name. ShapeId expectedName = ShapeId.fromParts(operation.getId().getNamespace(), operation.getId().getName() + suffix); @@ -170,7 +173,8 @@ private static StructureShape createSyntheticShape( OperationShape operation, String suffix, StructureShape source, - Trait inputOutputTrait) { + Trait inputOutputTrait + ) { ShapeId newId = createSyntheticShapeId(model, operation, suffix); // Special handling for copying unit types (that, you don't copy unit types) @@ -193,7 +197,8 @@ private static StructureShape createSyntheticShape( private static ShapeId createSyntheticShapeId( Model model, OperationShape operation, - String suffix) { + String suffix + ) { // Synthesize an input shape as a dedicated copy of the existing input. ShapeId newId = ShapeId.fromParts(operation.getId().getNamespace(), operation.getId().getName() + suffix); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/transform/DeconflictErrorsWithSharedStatusCode.java b/smithy-model/src/main/java/software/amazon/smithy/model/transform/DeconflictErrorsWithSharedStatusCode.java index 6bf08281b25..72665c77817 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/transform/DeconflictErrorsWithSharedStatusCode.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/transform/DeconflictErrorsWithSharedStatusCode.java @@ -88,7 +88,8 @@ Model transform(ModelTransformer transformer, Model model) { private Pair> synthesizeErrorUnion( String operationName, Integer statusCode, - List errors) { + List errors + ) { List replacementShapes = new ArrayList<>(); StructureShape.Builder errorResponse = StructureShape.builder(); ShapeId errorResponseId = ShapeId.fromParts(forService.getId().getNamespace(), diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/transform/ModelTransformer.java b/smithy-model/src/main/java/software/amazon/smithy/model/transform/ModelTransformer.java index 88e4bfdf2a0..9728a8a5967 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/transform/ModelTransformer.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/transform/ModelTransformer.java @@ -143,7 +143,8 @@ public Model removeShapesIf(Model model, Predicate predicate) { */ public Model renameShapes( Model model, - Map renamed) { + Map renamed + ) { return this.renameShapes(model, renamed, () -> Model.assembler().disableValidation()); } @@ -162,7 +163,8 @@ public Model renameShapes( public Model renameShapes( Model model, Map renamed, - Supplier modelAssemblerSupplier) { + Supplier modelAssemblerSupplier + ) { return new RenameShapes(renamed, modelAssemblerSupplier).transform(this, model); } @@ -492,7 +494,8 @@ public Model changeShapeType(Model model, Map shapeToType) { public Model changeShapeType( Model model, Map shapeToType, - ChangeShapeTypeOption... changeShapeTypeOptions) { + ChangeShapeTypeOption... changeShapeTypeOptions + ) { boolean synthesizeNames = ChangeShapeTypeOption.SYNTHESIZE_ENUM_NAMES.hasFeature(changeShapeTypeOptions); return new ChangeShapeType(shapeToType, synthesizeNames).transform(this, model); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/transform/RenameShapes.java b/smithy-model/src/main/java/software/amazon/smithy/model/transform/RenameShapes.java index d87dcf60f65..62c1f2f02b6 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/transform/RenameShapes.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/transform/RenameShapes.java @@ -81,7 +81,8 @@ private Model retypeListsBackToSets( ModelTransformer transformer, Model model, Set sets, - Map renamed) { + Map renamed + ) { if (sets.isEmpty()) { return model; } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanStructureAndUnionMembers.java b/smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanStructureAndUnionMembers.java index 3d1c2836d69..344e1a70ab5 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanStructureAndUnionMembers.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/transform/plugins/CleanStructureAndUnionMembers.java @@ -113,7 +113,8 @@ private Collection createUpdatedShapes( Model model, Collection removed, Function> containerShapeMapper, - Function>, S> entryMapperAndFactory) { + Function>, S> entryMapperAndFactory + ) { return removed.stream() .flatMap(shape -> OptionalUtils.stream(shape.asMemberShape())) .flatMap(member -> OptionalUtils.stream(model.getShape(member.getContainer()) diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/AbstractValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/AbstractValidator.java index e757a9976b5..f0ea06195ef 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/AbstractValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/AbstractValidator.java @@ -19,14 +19,16 @@ public String getName() { protected final ValidationEvent error( Shape shape, - String message) { + String message + ) { return createEvent(Severity.ERROR, shape, shape.getSourceLocation(), message); } protected final ValidationEvent error( Shape shape, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.ERROR, shape, shape.getSourceLocation(), message, eventIdSubpart1); } @@ -34,7 +36,8 @@ protected final ValidationEvent error( Shape shape, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.ERROR, shape, shape.getSourceLocation(), message, eventIdSubpart1, eventIdSubpart2); } @@ -43,7 +46,8 @@ protected final ValidationEvent error( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.ERROR, shape, shape.getSourceLocation(), @@ -56,7 +60,8 @@ protected final ValidationEvent error( protected final ValidationEvent error( Shape shape, FromSourceLocation location, - String message) { + String message + ) { return createEvent(Severity.ERROR, shape, location, message); } @@ -64,7 +69,8 @@ protected final ValidationEvent error( Shape shape, FromSourceLocation location, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.ERROR, shape, location, message, eventIdSubpart1); } @@ -73,7 +79,8 @@ protected final ValidationEvent error( FromSourceLocation location, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.ERROR, shape, location, message, eventIdSubpart1, eventIdSubpart2); } @@ -83,20 +90,23 @@ protected final ValidationEvent error( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.ERROR, shape, location, message, eventIdSubpart1, eventIdSubpart2, eventIdSubpart3); } protected final ValidationEvent danger( Shape shape, - String message) { + String message + ) { return createEvent(Severity.DANGER, shape, shape.getSourceLocation(), message); } protected final ValidationEvent danger( Shape shape, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.DANGER, shape, shape.getSourceLocation(), message, eventIdSubpart1); } @@ -104,7 +114,8 @@ protected final ValidationEvent danger( Shape shape, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.DANGER, shape, shape.getSourceLocation(), @@ -118,7 +129,8 @@ protected final ValidationEvent danger( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.DANGER, shape, shape.getSourceLocation(), @@ -131,7 +143,8 @@ protected final ValidationEvent danger( protected final ValidationEvent danger( Shape shape, FromSourceLocation location, - String message) { + String message + ) { return createEvent(Severity.DANGER, shape, location, message); } @@ -139,7 +152,8 @@ protected final ValidationEvent danger( Shape shape, FromSourceLocation location, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.DANGER, shape, location, message, eventIdSubpart1); } @@ -148,7 +162,8 @@ protected final ValidationEvent danger( FromSourceLocation location, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.DANGER, shape, location, message, eventIdSubpart1, eventIdSubpart2); } @@ -158,7 +173,8 @@ protected final ValidationEvent danger( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.DANGER, shape, location, @@ -170,14 +186,16 @@ protected final ValidationEvent danger( protected final ValidationEvent warning( Shape shape, - String message) { + String message + ) { return createEvent(Severity.WARNING, shape, shape.getSourceLocation(), message); } protected final ValidationEvent warning( Shape shape, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.WARNING, shape, shape.getSourceLocation(), message, eventIdSubpart1); } @@ -185,7 +203,8 @@ protected final ValidationEvent warning( Shape shape, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.WARNING, shape, shape.getSourceLocation(), @@ -199,7 +218,8 @@ protected final ValidationEvent warning( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.WARNING, shape, shape.getSourceLocation(), @@ -212,7 +232,8 @@ protected final ValidationEvent warning( protected final ValidationEvent warning( Shape shape, FromSourceLocation location, - String message) { + String message + ) { return createEvent(Severity.WARNING, shape, location, message); } @@ -220,7 +241,8 @@ protected final ValidationEvent warning( Shape shape, FromSourceLocation location, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.WARNING, shape, location, message, eventIdSubpart1); } @@ -229,7 +251,8 @@ protected final ValidationEvent warning( FromSourceLocation location, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.WARNING, shape, location, message, eventIdSubpart1, eventIdSubpart2); } @@ -239,7 +262,8 @@ protected final ValidationEvent warning( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.WARNING, shape, location, @@ -251,14 +275,16 @@ protected final ValidationEvent warning( protected final ValidationEvent note( Shape shape, - String message) { + String message + ) { return createEvent(Severity.NOTE, shape, shape.getSourceLocation(), message); } protected final ValidationEvent note( Shape shape, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.NOTE, shape, shape.getSourceLocation(), message, eventIdSubpart1); } @@ -266,7 +292,8 @@ protected final ValidationEvent note( Shape shape, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.NOTE, shape, shape.getSourceLocation(), message, eventIdSubpart1, eventIdSubpart2); } @@ -275,7 +302,8 @@ protected final ValidationEvent note( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.NOTE, shape, shape.getSourceLocation(), @@ -288,7 +316,8 @@ protected final ValidationEvent note( protected final ValidationEvent note( Shape shape, FromSourceLocation location, - String message) { + String message + ) { return createEvent(Severity.NOTE, shape, location, message); } @@ -296,7 +325,8 @@ protected final ValidationEvent note( Shape shape, FromSourceLocation location, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return createEvent(Severity.NOTE, shape, location, message, eventIdSubpart1); } @@ -305,7 +335,8 @@ protected final ValidationEvent note( FromSourceLocation location, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return createEvent(Severity.NOTE, shape, location, message, eventIdSubpart1, eventIdSubpart2); } @@ -315,7 +346,8 @@ protected final ValidationEvent note( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return createEvent(Severity.NOTE, shape, location, message, eventIdSubpart1, eventIdSubpart2, eventIdSubpart3); } @@ -323,7 +355,8 @@ protected final ValidationEvent createEvent( Severity severity, Shape shape, FromSourceLocation loc, - String message) { + String message + ) { return ValidationEvent.builder() .severity(severity) .message(message) @@ -338,7 +371,8 @@ protected final ValidationEvent createEvent( Shape shape, FromSourceLocation loc, String message, - String eventIdSubpart1) { + String eventIdSubpart1 + ) { return ValidationEvent.builder() .severity(severity) .message(message) @@ -354,7 +388,8 @@ protected final ValidationEvent createEvent( FromSourceLocation loc, String message, String eventIdSubpart1, - String eventIdSubpart2) { + String eventIdSubpart2 + ) { return ValidationEvent.builder() .severity(severity) .message(message) @@ -371,7 +406,8 @@ protected final ValidationEvent createEvent( String message, String eventIdSubpart1, String eventIdSubpart2, - String eventIdSubpart3) { + String eventIdSubpart3 + ) { return ValidationEvent.builder() .severity(severity) .message(message) diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java index 2a7311d2f02..c719c7b63ec 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/NodeValidationVisitor.java @@ -475,7 +475,8 @@ private ValidationEvent event( String message, Severity severity, SourceLocation sourceLocation, - String... additionalEventIdParts) { + String... additionalEventIdParts + ) { return ValidationEvent.builder() .id(additionalEventIdParts.length > 0 ? eventId + "." + String.join(".", additionalEventIdParts) diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidatorFactory.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidatorFactory.java index c26073f9277..5fbeae97e4a 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidatorFactory.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/ValidatorFactory.java @@ -100,7 +100,8 @@ public Optional createValidator(String name, ObjectNode configuration static ValidatorFactory createServiceFactory( Iterable validators, Iterable services, - Iterable decorators) { + Iterable decorators + ) { List serviceList = new ArrayList<>(); services.forEach(serviceList::add); List validatorsList = new ArrayList<>(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/NodeValidatorPlugin.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/NodeValidatorPlugin.java index a763b9e3fa2..725c4739357 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/NodeValidatorPlugin.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/node/NodeValidatorPlugin.java @@ -134,7 +134,8 @@ void accept( FromSourceLocation sourceLocation, Severity severity, String message, - String... additionalEventIdParts); + String... additionalEventIdParts + ); default void accept(FromSourceLocation sourceLocation, String message) { accept(sourceLocation, Severity.ERROR, message, EMPTY_STRING_ARRAY); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/suppressions/ModelBasedEventDecorator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/suppressions/ModelBasedEventDecorator.java index a9248bf3f91..3411e0682e0 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/suppressions/ModelBasedEventDecorator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/suppressions/ModelBasedEventDecorator.java @@ -95,7 +95,8 @@ public ValidationEvent decorate(ValidationEvent ev) { private static void loadMetadataSeverityOverrides( Model model, List severityOverrides, - List events) { + List events + ) { model.getMetadataProperty(SEVERITY_OVERRIDES).ifPresent(value -> { try { List values = value.expectArrayNode().getElementsAs(ObjectNode.class); @@ -115,7 +116,8 @@ private static void loadMetadataSeverityOverrides( private static void loadMetadataSuppressions( Model model, List suppressions, - List events) { + List events + ) { model.getMetadataProperty(SUPPRESSIONS).ifPresent(value -> { try { List values = value.expectArrayNode().getElementsAs(ObjectNode.class); @@ -136,7 +138,8 @@ private static ValidationEvent modifyEventSeverity( Model model, ValidationEvent event, List suppressions, - List severityOverrides) { + List severityOverrides + ) { // ERROR and SUPPRESSED events cannot be suppressed. if (!event.getSeverity().canSuppress()) { return event; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java index 50b379dc998..b721e4811f2 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/testrunner/SmithyTestCase.java @@ -201,7 +201,8 @@ public static final class Result { Result( String modelLocation, Collection unmatchedEvents, - Collection extraEvents) { + Collection extraEvents + ) { this.modelLocation = modelLocation; this.unmatchedEvents = Collections.unmodifiableCollection(new TreeSet<>(unmatchedEvents)); this.extraEvents = Collections.unmodifiableCollection(new TreeSet<>(extraEvents)); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/AuthTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/AuthTraitValidator.java index 5d85e70f1b7..b1ad92cbde1 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/AuthTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/AuthTraitValidator.java @@ -50,7 +50,8 @@ private void validateShape( Set serviceAuth, ServiceShape service, Shape shape, - List events) { + List events + ) { if (shape.getTrait(AuthTrait.class).isPresent()) { AuthTrait authTrait = shape.getTrait(AuthTrait.class).get(); Set appliedAuthTraitValue = new TreeSet<>(authTrait.getValueSet()); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/DefaultTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/DefaultTraitValidator.java index 898ef2b9d5f..b2b0eed3d3e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/DefaultTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/DefaultTraitValidator.java @@ -82,7 +82,8 @@ private NodeValidationVisitor validateShapeValue( Shape shape, DefaultTrait trait, NodeValidationVisitor visitor, - List events) { + List events + ) { Node value = trait.toNode(); Shape shapeTarget = shape; @@ -155,7 +156,8 @@ private NodeValidationVisitor createOrReuseVisitor( Model model, NodeValidationVisitor visitor, Node value, - Shape shape) { + Shape shape + ) { if (visitor == null) { return NodeValidationVisitor .builder() diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExamplesTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExamplesTraitValidator.java index 786894afc64..6b3c8017063 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExamplesTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExamplesTraitValidator.java @@ -131,7 +131,8 @@ private NodeValidationVisitor createVisitor( ObjectNode value, Model model, Shape shape, - ExamplesTrait.Example example) { + ExamplesTrait.Example example + ) { NodeValidationVisitor.Builder builder = NodeValidationVisitor.builder() .model(model) .eventShapeId(shape.getId()) diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExclusiveStructureMemberTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExclusiveStructureMemberTraitValidator.java index 17a27bbfb63..362c54a69ae 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExclusiveStructureMemberTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ExclusiveStructureMemberTraitValidator.java @@ -50,7 +50,8 @@ public List validate(Model model) { private void validateExclusiveMembers( Shape shape, Set exclusiveMemberTraits, - List events) { + List events + ) { for (ShapeId traitId : exclusiveMemberTraits) { List matches = new ArrayList<>(); for (MemberShape member : shape.members()) { @@ -74,7 +75,8 @@ private void validateExclusiveTargets( Model model, Shape shape, Set exclusiveTargets, - List events) { + List events + ) { // Find all member targets that violate the exclusion rule (e.g., streaming trait). for (ShapeId id : exclusiveTargets) { List matches = new ArrayList<>(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java index 480320edcbc..320b944f2a3 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HostLabelTraitValidator.java @@ -67,7 +67,8 @@ public List validate(Model model) { private List validateStructure( Model model, OperationShape operation, - EndpointTrait endpoint) { + EndpointTrait endpoint + ) { List events = new ArrayList<>(); // Validate the host can become a valid RFC 3986 Section 3.2.2 host. @@ -88,7 +89,8 @@ private List validateStructure( private List validateBindings( OperationShape operation, EndpointTrait endpoint, - StructureShape input) { + StructureShape input + ) { List events = new ArrayList<>(); SmithyPattern hostPrefix = endpoint.getHostPrefix(); @@ -131,7 +133,8 @@ private List validateBindings( private Optional validateExpandedPattern( OperationShape operation, - EndpointTrait endpoint) { + EndpointTrait endpoint + ) { // Replace all label portions with stubs so the hostPrefix // can be validated. String stubHostPrefix = endpoint.getHostPrefix() diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingTraitIgnoredValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingTraitIgnoredValidator.java index f3537ef769d..7c181db66cd 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingTraitIgnoredValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingTraitIgnoredValidator.java @@ -101,7 +101,8 @@ private List checkRelationships( StructureShape containerShape, MemberShape memberShape, Map traits, - NeighborProvider reverse) { + NeighborProvider reverse + ) { // Prepare which traits need relationship tracking for. Set ignoredOutsideInputTraits = new HashSet<>(traits.keySet()); ignoredOutsideInputTraits.retainAll(IGNORED_OUTSIDE_INPUT); @@ -183,7 +184,8 @@ private ValidationEvent emit( MemberShape memberShape, Trait trait, int checkedRelationshipCount, - Map> ignoredRelationships) { + Map> ignoredRelationships + ) { String mixedIn = memberShape.getMixins().isEmpty() ? "" : " mixed in"; String message = "The `%s` trait applied to this%s member is "; if (checkedRelationshipCount == ignoredRelationships.size()) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingsMissingValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingsMissingValidator.java index c70ec52704f..0f40ff23fca 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingsMissingValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpBindingsMissingValidator.java @@ -78,7 +78,8 @@ private List validateOperations( ServiceShape service, Set operations, Severity severity, - String reason) { + String reason + ) { return operations.stream() .filter(operation -> !operation.getTrait(HttpTrait.class).isPresent()) .map(operation -> createEvent(severity, diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpLabelTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpLabelTraitValidator.java index a43073b85a0..99aa3c6e49e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpLabelTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpLabelTraitValidator.java @@ -61,7 +61,8 @@ private List validateBindings( Model model, OperationShape operation, HttpTrait http, - StructureShape input) { + StructureShape input + ) { List events = new ArrayList<>(); // Create a set of labels and remove from the set when a match is diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java index f1784e60ec9..a76c3a69f76 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpMethodSemanticsValidator.java @@ -91,7 +91,8 @@ public List validate(Model model) { private List validateOperation( HttpBindingIndex bindingIndex, OperationShape shape, - HttpTrait trait) { + HttpTrait trait + ) { String method = trait.getMethod().toUpperCase(Locale.US); // We don't have a standard method, so we can't validate it. @@ -185,7 +186,8 @@ private HttpMethodSemantics( Boolean isReadonly, Boolean isIdempotent, Boolean allowsRequestPayload, - String warningWhenModeled) { + String warningWhenModeled + ) { this.isReadonly = isReadonly; this.isIdempotent = isIdempotent; this.allowsRequestPayload = allowsRequestPayload; diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPayloadValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPayloadValidator.java index 2e316a2daab..6604f25d4ab 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPayloadValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPayloadValidator.java @@ -56,7 +56,8 @@ public List validate(Model model) { private List validateOperation( HttpBindingIndex bindings, OperationIndex opIndex, - OperationShape shape) { + OperationShape shape + ) { List events = new ArrayList<>(); validatePayload(shape.getId(), opIndex.expectInputShape(shape), bindings, true).ifPresent(events::add); validatePayload(shape.getId(), opIndex.expectOutputShape(shape), bindings, false).ifPresent(events::add); @@ -73,7 +74,8 @@ private Optional validatePayload( ShapeId subject, StructureShape inputOrError, HttpBindingIndex bindings, - boolean request) { + boolean request + ) { Map resolved = request ? bindings.getRequestBindings(subject) : bindings.getResponseBindings(subject); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPrefixHeadersTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPrefixHeadersTraitValidator.java index dceb2915034..32634ce5757 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPrefixHeadersTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpPrefixHeadersTraitValidator.java @@ -37,7 +37,8 @@ public List validate(Model model) { private List validateMember( StructureShape structure, MemberShape member, - HttpPrefixHeadersTrait prefixTrait) { + HttpPrefixHeadersTrait prefixTrait + ) { List events = new ArrayList<>(); String prefix = prefixTrait.getValue().toLowerCase(Locale.ENGLISH); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpQueryTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpQueryTraitValidator.java index a077ef6c4ab..c2a85203bd1 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpQueryTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpQueryTraitValidator.java @@ -59,7 +59,8 @@ private Map>> getQueryBindings(Model mod private List validateBindings( Map>> queryBindings, - Map> structureToOperations) { + Map> structureToOperations + ) { List events = new ArrayList<>(); for (Map.Entry>> entry : queryBindings.entrySet()) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpUriConflictValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpUriConflictValidator.java index 50d555b60f7..447440d2a6f 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpUriConflictValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/HttpUriConflictValidator.java @@ -69,7 +69,8 @@ private List checkConflicts( Model model, OperationShape operation, HttpTrait httpTrait, - List operations) { + List operations + ) { String method = httpTrait.getMethod(); UriPattern pattern = httpTrait.getUri(); @@ -153,7 +154,8 @@ private boolean isAllowableConflict( OperationShape operation, SmithyPattern otherPattern, OperationShape otherOperation, - BiFunction> getLabelPatterns) { + BiFunction> getLabelPatterns + ) { Map conflictingLabelSegments = pattern.getConflictingLabelSegmentsMap(otherPattern); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/IdempotencyTokenIgnoredValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/IdempotencyTokenIgnoredValidator.java index 235d085087b..0c7e8a5848c 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/IdempotencyTokenIgnoredValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/IdempotencyTokenIgnoredValidator.java @@ -57,7 +57,8 @@ private void checkRelationships( MemberShape memberShape, Trait trait, NeighborProvider reverse, - List events) { + List events + ) { // Store relationships so we can emit one event per ignored binding. Map> ignoredRelationships = new TreeMap<>(); @@ -82,7 +83,8 @@ private void checkRelationships( private ValidationEvent emit( MemberShape memberShape, Trait trait, - Map> ignoredRelationships) { + Map> ignoredRelationships + ) { String message = "The `idempotencyToken` trait only has an effect when applied to a top-level operation input member, " + "but it was applied and ignored in the following contexts: " diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/MemberShouldReferenceResourceValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/MemberShouldReferenceResourceValidator.java index bf901a49609..fa7e0ab88c6 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/MemberShouldReferenceResourceValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/MemberShouldReferenceResourceValidator.java @@ -103,7 +103,8 @@ private void computeResourcesToIgnore( Model model, MemberShape member, ResourceShape resource, - Set resourcesToIgnore) { + Set resourcesToIgnore + ) { // Exclude actually bound members via searching with a PathFinder. List resourceMemberPaths = PathFinder.create(model) .search(resource, ListUtils.of(member)); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/OperationValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/OperationValidator.java index 743b03ff795..fe55ec6ac8e 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/OperationValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/OperationValidator.java @@ -69,7 +69,8 @@ private void validateInputOutput( NeighborProvider reverseProvider, List events, String descriptor, - String invalid) { + String invalid + ) { for (Shape shape : shapes) { Set operations = new HashSet<>(); for (Relationship rel : reverseProvider.getNeighbors(shape)) { @@ -101,7 +102,8 @@ private ValidationEvent emitInvalidOperationBinding( Shape operation, Shape target, String property, - String invalid) { + String invalid + ) { return ValidationEvent.builder() .id(OPERATION_INPUT_OUTPUT_MISUSE) .severity(Severity.ERROR) @@ -173,7 +175,8 @@ private ValidationEvent createAmbiguousEvent( Shape ambiguousShape, OperationShape operation, ShapeId ioShape, - String descriptor) { + String descriptor + ) { return ValidationEvent.builder() .id(OPERATION_NAME_AMBIGUITY) .shape(ambiguousShape) diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PaginatedTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PaginatedTraitValidator.java index f52c5368e31..703cb523b7d 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PaginatedTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/PaginatedTraitValidator.java @@ -78,7 +78,8 @@ private List validateOperation( TopDownIndex topDownIndex, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait) { + PaginatedTrait trait + ) { List events = new ArrayList<>(); // Validate input. @@ -123,7 +124,8 @@ private List validateMember( ServiceShape service, OperationShape operation, PaginatedTrait trait, - PropertyValidator validator) { + PropertyValidator validator + ) { String prefix = service != null ? "When bound within the `" + service.getId() + "` service, " : ""; String memberPath = validator.getMemberPath(opIndex, operation, trait).orElse(null); @@ -238,7 +240,8 @@ abstract Optional getMember( Model model, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait); + PaginatedTrait trait + ); boolean pathsAllowed() { return false; @@ -256,7 +259,8 @@ Optional getMember( Model model, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait) { + PaginatedTrait trait + ) { StructureShape outputShape = opIndex.expectOutputShape(operation); return getMemberPath(opIndex, operation, trait) .map(path -> PaginatedTrait.resolveFullPath(path, model, outputShape)) @@ -298,7 +302,8 @@ Optional getMember( Model model, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait) { + PaginatedTrait trait + ) { StructureShape input = opIndex.expectInputShape(operation); return getMemberPath(opIndex, operation, trait).flatMap(input::getMember); } @@ -359,7 +364,8 @@ Optional getMember( Model model, OperationIndex opIndex, OperationShape operation, - PaginatedTrait trait) { + PaginatedTrait trait + ) { StructureShape input = opIndex.expectInputShape(operation); return getMemberPath(opIndex, operation, trait).flatMap(input::getMember); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/RangeTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/RangeTraitValidator.java index 33f617f6843..6af553ab9d6 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/RangeTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/RangeTraitValidator.java @@ -61,7 +61,8 @@ private Optional validateRangeProperty( Shape shape, RangeTrait trait, BigDecimal property, - String name) { + String name + ) { if (!property.remainder(BigDecimal.ONE).equals(BigDecimal.ZERO)) { if (shape.isMemberShape()) { MemberShape member = shape.asMemberShape().get(); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ReferencesTraitValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ReferencesTraitValidator.java index ae958a01119..fc6ed1d678d 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ReferencesTraitValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ReferencesTraitValidator.java @@ -82,7 +82,8 @@ private List validateSingleReference( ReferencesTrait.Reference reference, Shape shape, ReferencesTrait trait, - ResourceShape target) { + ResourceShape target + ) { if (shape.asStructureShape().isPresent()) { return validateStructureRef(model, reference, shape.asStructureShape().get(), trait, target); } else if (shape.asStringShape().isPresent()) { @@ -96,7 +97,8 @@ private List validateStringShapeRef( ReferencesTrait.Reference reference, StringShape shape, ReferencesTrait trait, - ResourceShape target) { + ResourceShape target + ) { // You can only reference a resource with a single ID on a string shape. if (target.getIdentifiers().size() != 1) { return ListUtils.of(error(shape, @@ -122,7 +124,8 @@ private List validateStructureRef( ReferencesTrait.Reference reference, StructureShape shape, ReferencesTrait trait, - ResourceShape target) { + ResourceShape target + ) { List events = new ArrayList<>(); Map resolvedIds = resolveIds(reference, target); boolean implicit = !resolvedIds.equals(reference.getIds()); @@ -166,7 +169,8 @@ private void validateExplicitIds( ReferencesTrait trait, ResourceShape target, Map resolvedIds, - List events) { + List events + ) { // References require the exact number of entries as the identifiers of the resource. if (resolvedIds.size() != target.getIdentifiers().size()) { events.add(wrongNumberOfIdentifiers(shape, trait, reference, target.getIdentifiers().keySet())); @@ -184,7 +188,8 @@ private ValidationEvent wrongNumberOfIdentifiers( Shape shape, ReferencesTrait trait, ReferencesTrait.Reference reference, - Collection expectedNames) { + Collection expectedNames + ) { String prefix = expectedNames.size() < reference.getIds().size() ? "Too many identifiers" : "Not enough identifiers"; @@ -205,7 +210,8 @@ private ValidationEvent extraneousIdentifiers( ReferencesTrait trait, ReferencesTrait.Reference reference, ResourceShape resource, - Collection extraneousKeys) { + Collection extraneousKeys + ) { return error(shape, trait, String.format( @@ -223,7 +229,8 @@ private Optional validateErrors( ReferencesTrait trait, ReferencesTrait.Reference reference, boolean implicit, - Map errors) { + Map errors + ) { List messages = new ArrayList<>(); errors.forEach((name, reason) -> { switch (reason) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceIdentifierBindingValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceIdentifierBindingValidator.java index 8fd4a05b490..12c452cc886 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceIdentifierBindingValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceIdentifierBindingValidator.java @@ -135,7 +135,8 @@ private void validateOperationBindings(Model model, List events private Stream validateResource( Model model, ResourceShape parent, - IdentifierBindingIndex bindingIndex) { + IdentifierBindingIndex bindingIndex + ) { return parent.getResources() .stream() .flatMap(childId -> OptionalUtils.stream(model.getShape(childId).flatMap(Shape::asResourceShape))) @@ -151,7 +152,8 @@ private Optional validateOperation( ResourceShape parent, ResourceShape child, OperationShape operation, - IdentifierBindingIndex bindingIndex) { + IdentifierBindingIndex bindingIndex + ) { if (bindingIndex.getOperationBindingType(child, operation) != IdentifierBindingIndex.BindingType.NONE) { Set bindings = bindingIndex.getOperationInputBindings(child, operation).keySet(); Set missing = parent.getIdentifiers() @@ -177,7 +179,8 @@ private Optional validateOperation( private Stream validateCollectionBindings( Model model, ResourceShape resource, - IdentifierBindingIndex identifierIndex) { + IdentifierBindingIndex identifierIndex + ) { return resource.getAllOperations() .stream() // Find all collection operations bound to the resource. @@ -197,7 +200,8 @@ private Stream validateCollectionBindings( private Stream validateInstanceBindings( Model model, ResourceShape resource, - IdentifierBindingIndex bindingIndex) { + IdentifierBindingIndex bindingIndex + ) { return resource.getAllOperations() .stream() // Find all instance operations bound to the resource. @@ -225,7 +229,8 @@ private Stream validateInstanceBindings( private boolean hasAllIdentifiersBound( ResourceShape resource, OperationShape operation, - IdentifierBindingIndex bindingIndex) { + IdentifierBindingIndex bindingIndex + ) { return bindingIndex.getOperationInputBindings(resource, operation) .keySet() .containsAll(resource.getIdentifiers().keySet()); diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceLifecycleValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceLifecycleValidator.java index 91cbe0b1741..e31a2dd47fc 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceLifecycleValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceLifecycleValidator.java @@ -68,7 +68,8 @@ private Optional validateReadonly( ResourceShape resource, OperationShape operation, String lifecycle, - boolean requireReadOnly) { + boolean requireReadOnly + ) { if (requireReadOnly == operation.hasTrait(ReadonlyTrait.class)) { return Optional.empty(); } @@ -86,7 +87,8 @@ private Optional validateIdempotent( ResourceShape resource, OperationShape operation, String lifecycle, - String additionalMessage) { + String additionalMessage + ) { if (operation.hasTrait(IdempotentTrait.class)) { return Optional.empty(); } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceOperationInputOutputValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceOperationInputOutputValidator.java index cbb60a2fca7..c5d0c1b5559 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceOperationInputOutputValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceOperationInputOutputValidator.java @@ -109,7 +109,8 @@ private void processLifecycleOperationProperties( Optional operationShapeId, PropertyBindingIndex propertyBindingIndex, Set propertiesInOperations, - List events) { + List events + ) { operationShapeId.flatMap(model::getShape).flatMap(Shape::asOperationShape).ifPresent(operation -> { propertiesInOperations.addAll(getAllOperationProperties(propertyBindingIndex, operation)); validateOperationInputOutput(model, @@ -123,7 +124,8 @@ private void processLifecycleOperationProperties( private List getAllOperationProperties( PropertyBindingIndex propertyBindingIndex, - OperationShape operation) { + OperationShape operation + ) { List properties = new ArrayList<>(); for (MemberShape member : propertyBindingIndex.getInputPropertiesShape(operation).members()) { if (propertyBindingIndex.isMemberShapeProperty(member)) { @@ -144,7 +146,8 @@ private void validateOperationInputOutput( ResourceShape resource, OperationShape operation, String lifecycleOperationName, - List events) { + List events + ) { validateOperationInput(model, propertyBindingIndex, resource, operation, lifecycleOperationName, events); validateOperationOutput(model, propertyBindingIndex, resource, operation, lifecycleOperationName, events); } @@ -155,7 +158,8 @@ private void validateOperationOutput( ResourceShape resource, OperationShape operation, String lifecycleOperationName, - List events) { + List events + ) { Map properties = resource.getProperties(); Map> propertyToMemberMappings = new TreeMap<>(); IdentifierBindingIndex identifierBindingIndex = IdentifierBindingIndex.of(model); @@ -185,7 +189,8 @@ private void validateOperationInput( ResourceShape resource, OperationShape operation, String lifecycleOperationName, - List events) { + List events + ) { Map properties = resource.getProperties(); Map> propertyToMemberMappings = new TreeMap<>(); IdentifierBindingIndex identifierBindingIndex = IdentifierBindingIndex.of(model); @@ -212,7 +217,8 @@ private void validateOperationInput( private void validateConflictingProperties( List events, Shape shape, - Map> propertyToMemberMappings) { + Map> propertyToMemberMappings + ) { for (Map.Entry> entry : propertyToMemberMappings.entrySet()) { if (entry.getValue().size() > 1) { events.add(error(shape, @@ -235,7 +241,8 @@ private void validateMember( MemberShape member, Set identifierMembers, Map properties, - Map> propertyToMemberMappings) { + Map> propertyToMemberMappings + ) { String propertyName = propertyBindingIndex.getPropertyName(member.getId()).get(); propertyToMemberMappings.computeIfAbsent(propertyName, m -> new TreeSet<>()).add(member); if (properties.containsKey(propertyName)) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java index 44631537826..0e894171056 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TargetValidator.java @@ -82,7 +82,8 @@ private void validateShape( Model model, Shape shape, List relationships, - List mutableEvents) { + List mutableEvents + ) { for (Relationship relationship : relationships) { if (relationship.getNeighborShape().isPresent()) { validateTarget(model, shape, relationship.getNeighborShape().get(), relationship, mutableEvents); @@ -97,7 +98,8 @@ private void validateTarget( Shape shape, Shape target, Relationship rel, - List events) { + List events + ) { RelationshipType relType = rel.getRelationshipType(); if (relType != RelationshipType.MIXIN && relType.getDirection() == RelationshipDirection.DIRECTED) { @@ -201,7 +203,8 @@ private void validateDeprecatedTargets( Shape shape, Shape target, RelationshipType relType, - List events) { + List events + ) { if (!target.hasTrait(DeprecatedTrait.class)) { return; } diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java index 80ab812a1b8..7469c7701ea 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitConflictValidator.java @@ -53,7 +53,8 @@ private void findAndCollectConflicts( Model model, ShapeId trait, List conflicts, - Map>> shapeToTraitConflicts) { + Map>> shapeToTraitConflicts + ) { for (Shape shape : model.getShapesWithTrait(trait)) { for (ShapeId conflict : conflicts) { if (shape.hasTrait(conflict)) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitTargetValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitTargetValidator.java index fa55eaff082..628a35c36f4 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitTargetValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitTargetValidator.java @@ -81,7 +81,8 @@ private void validateTraitTargets( Model model, List events, Selector selector, - List traits) { + List traits + ) { Set matches = selector.select(model); for (ShapeId traitId : traits) { diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValidatorsValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValidatorsValidator.java index edebfb1486d..26ed7ed03cc 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValidatorsValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValidatorsValidator.java @@ -56,7 +56,8 @@ private void emitIncompatibleShapes( Model model, Shape traitWithValidators, Shape appliedShape, - List events) { + List events + ) { Selector.StartingContext startingEnv = new Selector.StartingContext(Collections.singleton(appliedShape)); TraitValidatorsTrait trait = traitWithValidators.expectTrait(TraitValidatorsTrait.class); @@ -81,7 +82,8 @@ private ValidationEvent createEvent( String eventId, Shape shape, Severity severity, - String suffix) { + String suffix + ) { String suffixMessage = suffix == null ? "" : ": " + suffix; String message = String.format( "Found an incompatible shape when validating the constraints of the `%s` trait " diff --git a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValueValidator.java b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValueValidator.java index 366db5ca93c..8f74d6f127a 100644 --- a/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValueValidator.java +++ b/smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/TraitValueValidator.java @@ -51,7 +51,8 @@ private List validateTrait( NodeValidationVisitor validator, Shape targetShape, Trait trait, - boolean validatePrelude) { + boolean validatePrelude + ) { ShapeId shape = trait.toShapeId(); if (!model.getShape(shape).isPresent()) { diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/ShapeMatcher.java b/smithy-model/src/test/java/software/amazon/smithy/model/ShapeMatcher.java index 5941a797cce..833e5ceb2b8 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/ShapeMatcher.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/ShapeMatcher.java @@ -38,7 +38,8 @@ public ShapeMatcher( Class shapeType, ValidatedResult result, String description, - List, Function>> assertions) { + List, Function>> assertions + ) { this.shapeType = shapeType; this.result = result; this.description = description; @@ -71,7 +72,8 @@ public static ShapeMatcher hasEvent( ValidatedResult result, String eventId, Severity severity, - String messageContains) { + String messageContains + ) { return builderFor(Shape.class, result).addEventAssertion(eventId, severity, messageContains).build(); } @@ -99,7 +101,8 @@ private static boolean findEvent( String eventId, ToShapeId id, Severity severity, - String contains) { + String contains + ) { for (ValidationEvent event : result.getValidationEvents()) { if (event.getShapeId().filter(sid -> sid.equals(id.toShapeId())).isPresent() && event.getSeverity() == severity diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/knowledge/NullableIndexTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/knowledge/NullableIndexTest.java index 3373a812c33..2561a5c01ac 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/knowledge/NullableIndexTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/knowledge/NullableIndexTest.java @@ -176,7 +176,8 @@ public void takesNullableIntoAccount( boolean bar, boolean baz, boolean bam, - boolean boo) { + boolean boo + ) { StringShape str = StringShape.builder().id("smithy.example#Str").build(); StructureShape struct = StructureShape.builder() .id("smithy.example#Struct") diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/selector/SelectorTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/selector/SelectorTest.java index c268ea7a528..008f2998f57 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/selector/SelectorTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/selector/SelectorTest.java @@ -936,7 +936,8 @@ public void canQueryVariablesAtPointTheyWereMatched() { private void checkMatches( Iterable>>> matches, String message, - BiPredicate>> test) { + BiPredicate>> test + ) { for (Pair>> match : matches) { if (test.test(match.left, match.right)) { return; diff --git a/smithy-model/src/test/java/software/amazon/smithy/model/shapes/ShapeIdTest.java b/smithy-model/src/test/java/software/amazon/smithy/model/shapes/ShapeIdTest.java index 38ff7151a95..fe8abbf34f7 100644 --- a/smithy-model/src/test/java/software/amazon/smithy/model/shapes/ShapeIdTest.java +++ b/smithy-model/src/test/java/software/amazon/smithy/model/shapes/ShapeIdTest.java @@ -268,7 +268,8 @@ public void toStringTest( final String namespace, final String name, final String member, - final String expectedResult) { + final String expectedResult + ) { ShapeId shapeId = ShapeId.fromParts(namespace, name, member); assertEquals(expectedResult, shapeId.toString()); diff --git a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/ResolvedTopicIndex.java b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/ResolvedTopicIndex.java index 430201d3978..12a8fd940e6 100644 --- a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/ResolvedTopicIndex.java +++ b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/ResolvedTopicIndex.java @@ -126,7 +126,8 @@ public Optional getSubcribeEventStreamInfo(ToShapeId operation) private void createPublishBindings( OperationIndex operationIndex, OperationShape operation, - PublishTrait trait) { + PublishTrait trait + ) { StructureShape input = operationIndex.expectInputShape(operation); TopicBinding topicBinding = new TopicBinding<>(operation, trait, trait.getTopic(), input, input); publishBindings.put(operation.getId(), topicBinding); @@ -136,7 +137,8 @@ private void createSubscribeBinding( StructureShape input, EventStreamIndex eventStreamIndex, OperationShape operation, - SubscribeTrait trait) { + SubscribeTrait trait + ) { EventStreamInfo outputInfo = eventStreamIndex.getOutputInfo(operation).orElse(null); // Subscribe operations must have an event stream. Omit the bindings diff --git a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/TopicBinding.java b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/TopicBinding.java index 4bb45265aa2..1a69b26af09 100644 --- a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/TopicBinding.java +++ b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/TopicBinding.java @@ -62,7 +62,8 @@ public final class TopicBinding { T mqttTrait, Topic topic, Shape payloadShape, - StructureShape input) { + StructureShape input + ) { this.operation = operation; this.mqttTrait = mqttTrait; this.topic = topic; diff --git a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/validators/MqttTopicConflictValidator.java b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/validators/MqttTopicConflictValidator.java index 667ca242f69..dfb3b41c1bd 100644 --- a/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/validators/MqttTopicConflictValidator.java +++ b/smithy-mqtt-traits/src/main/java/software/amazon/smithy/mqtt/traits/validators/MqttTopicConflictValidator.java @@ -42,7 +42,8 @@ public List validate(Model model) { private ValidationEvent invalidBindings( TopicBinding binding, - List> conflicts) { + List> conflicts + ) { String payloadShape = binding.getPayloadShape() .map(shape -> shape.getId().toString()) .orElse("N/A"); diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java index efbed0772bd..6b252ee5f02 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiUtils.java @@ -28,7 +28,8 @@ private OpenApiUtils() {} */ public static String getSpecificationExtensionName( ShapeId metaTraitId, - SpecificationExtensionTrait specificationExtensionTrait) { + SpecificationExtensionTrait specificationExtensionTrait + ) { return specificationExtensionTrait.getAs() .orElse("x-" + metaTraitId.toString().replaceAll("[.#]", "-")); } diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiVersion.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiVersion.java index 346a67c20da..681e20f4eaa 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiVersion.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/OpenApiVersion.java @@ -32,7 +32,8 @@ public enum OpenApiVersion { String version, boolean supportsContentEncodingKeyword, JsonSchemaVersion jsonSchemaVersion, - Set unsupportedKeywords) { + Set unsupportedKeywords + ) { this.version = version; this.supportsContentEncodingKeyword = supportsContentEncodingKeyword; this.jsonSchemaVersion = jsonSchemaVersion; diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/Context.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/Context.java index 3d4ac24c748..e3f3c442d82 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/Context.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/Context.java @@ -44,7 +44,8 @@ public final class Context { JsonSchemaConverter jsonSchemaConverter, OpenApiProtocol openApiProtocol, SchemaDocument schemas, - List> securitySchemeConverters) { + List> securitySchemeConverters + ) { this.model = model; this.service = service; this.config = config; @@ -218,14 +219,16 @@ public Set getAllSecuritySchemeResponseHeaders() { private static Set getSecuritySchemeRequestHeaders( Context context, - SecuritySchemeConverter converter) { + SecuritySchemeConverter converter + ) { T t = context.getService().expectTrait(converter.getAuthSchemeType()); return converter.getAuthRequestHeaders(context, t); } private static Set getSecuritySchemeResponseHeaders( Context context, - SecuritySchemeConverter converter) { + SecuritySchemeConverter converter + ) { T t = context.getService().expectTrait(converter.getAuthSchemeType()); return converter.getAuthResponseHeaders(context, t); } diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java index 264b2fc031e..a5a2ccee2a9 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverter.java @@ -251,7 +251,8 @@ private ConversionEnvironment createConversionEnvironment(Model private static OpenApiMapper createComposedMapper( List extensions, - List mappers) { + List mappers + ) { return OpenApiMapper.compose(Stream.concat( extensions.stream().flatMap(extension -> extension.getOpenApiMappers().stream()), mappers.stream()).collect(Collectors.toList())); @@ -303,7 +304,8 @@ private ConversionEnvironment( Context context, List extensions, ComponentsObject.Builder components, - OpenApiMapper composedMapper) { + OpenApiMapper composedMapper + ) { this.context = context; this.extensions = extensions; this.components = components; @@ -351,7 +353,8 @@ private OpenApi convertWithEnvironment(ConversionEnvironment OpenApiProtocol loadOpenApiProtocol( ServiceShape service, T protocolTrait, - List extensions) { + List extensions + ) { // Collect into a list so that a better error message can be presented if the // protocol converter can't be found. List protocolProviders = extensions.stream() @@ -379,7 +382,8 @@ private OpenApiProtocol loadOpenApiProtocol( private List> loadSecuritySchemes( Model model, ServiceShape service, - List extensions) { + List extensions + ) { // Note: Using a LinkedHashSet here in case order is ever important. ServiceIndex serviceIndex = ServiceIndex.of(model); Set> schemes = getTraitMapTypes(serviceIndex.getAuthSchemes(service)); @@ -434,7 +438,8 @@ private void addPaths( Context context, OpenApi.Builder openApiBuilder, OpenApiProtocol protocolService, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { TopDownIndex topDownIndex = TopDownIndex.of(context.getModel()); Map paths = new HashMap<>(); @@ -529,7 +534,8 @@ private void addOperationSecurity( Context context, OperationObject.Builder builder, OperationShape shape, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { ServiceShape service = context.getService(); ServiceIndex serviceIndex = ServiceIndex.of(context.getModel()); Map serviceSchemes = serviceIndex.getEffectiveAuthSchemes(service); @@ -566,7 +572,8 @@ private void addOperationSecurity( private

List createSecurityRequirements( Context

context, SecuritySchemeConverter converter, - ServiceShape service) { + ServiceShape service + ) { return converter.createSecurityRequirements( context, service.expectTrait(converter.getAuthSchemeType()), @@ -576,7 +583,8 @@ private

List createSecurityRequiremen private OperationObject addOperationTags( Context context, Shape shape, - OperationObject operation) { + OperationObject operation + ) { // Include @tags trait tags of the operation that are compatible with OpenAPI settings. if (context.getConfig().getTags()) { return operation.toBuilder().tags(getSupportedTags(shape)).build(); @@ -592,7 +600,8 @@ private OperationObject updateParameters( OperationObject operation, String method, String path, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { List parameters = new ArrayList<>(); for (ParameterObject parameter : operation.getParameters()) { parameters.add(plugin.updateParameter(context, shape, method, path, parameter)); @@ -610,7 +619,8 @@ private OperationObject updateRequestBody( OperationObject operation, String method, String path, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { return operation.getRequestBody() .map(body -> { RequestBodyObject updatedBody = plugin.updateRequestBody(context, shape, method, path, body); @@ -629,7 +639,8 @@ private OperationObject updateResponses( OperationObject operation, String methodName, String path, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { Map newResponses = new LinkedHashMap<>(); for (Map.Entry entry : operation.getResponses().entrySet()) { String status = entry.getKey(); @@ -654,7 +665,8 @@ private void addSecurityComponents( Context context, OpenApi.Builder openApiBuilder, ComponentsObject.Builder components, - OpenApiMapper plugin) { + OpenApiMapper plugin + ) { ServiceShape service = context.getService(); ServiceIndex serviceIndex = ServiceIndex.of(context.getModel()); @@ -696,7 +708,8 @@ private

SecurityScheme createAndUpdateSecurit Context

context, OpenApiMapper plugin, SecuritySchemeConverter converter, - ServiceShape service) { + ServiceShape service + ) { A authTrait = service.expectTrait(converter.getAuthSchemeType()); SecurityScheme createdScheme = converter.createSecurityScheme(context, authTrait); return plugin.updateSecurityScheme(context, authTrait, createdScheme); @@ -705,7 +718,8 @@ private

SecurityScheme createAndUpdateSecurit @SuppressWarnings("unchecked") private Collection> findMatchingConverters( Context context, - Collection> schemes) { + Collection> schemes + ) { return context.getSecuritySchemeConverters() .stream() .filter(converter -> schemes.contains(converter.getAuthSchemeType())) diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiMapper.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiMapper.java index e5eea798fee..f33bb666912 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiMapper.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/OpenApiMapper.java @@ -77,7 +77,8 @@ default OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { return operation; } @@ -99,7 +100,8 @@ default OperationObject postProcessOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { return operation; } @@ -130,7 +132,8 @@ default ParameterObject updateParameter( OperationShape operation, String httpMethodName, String path, - ParameterObject parameterObject) { + ParameterObject parameterObject + ) { return parameterObject; } @@ -149,7 +152,8 @@ default RequestBodyObject updateRequestBody( OperationShape operation, String httpMethodName, String path, - RequestBodyObject requestBody) { + RequestBodyObject requestBody + ) { return requestBody; } @@ -170,7 +174,8 @@ default ResponseObject updateResponse( String status, String httpMethodName, String path, - ResponseObject response) { + ResponseObject response + ) { return response; } @@ -193,7 +198,8 @@ default void before(Context context, OpenApi.Builder builder) { default SecurityScheme updateSecurityScheme( Context context, Trait authTrait, - SecurityScheme securityScheme) { + SecurityScheme securityScheme + ) { return securityScheme; } @@ -215,7 +221,8 @@ default Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { return requirement; } @@ -266,7 +273,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { for (OpenApiMapper plugin : sorted) { if (operation == null) { return null; @@ -282,7 +290,8 @@ public OperationObject postProcessOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { for (OpenApiMapper plugin : sorted) { if (operation == null) { return null; @@ -309,7 +318,8 @@ public ParameterObject updateParameter( OperationShape operation, String httpMethodName, String path, - ParameterObject parameterObject) { + ParameterObject parameterObject + ) { for (OpenApiMapper plugin : sorted) { if (parameterObject == null) { return null; @@ -330,7 +340,8 @@ public RequestBodyObject updateRequestBody( OperationShape shape, String httpMethodName, String path, - RequestBodyObject requestBody) { + RequestBodyObject requestBody + ) { for (OpenApiMapper plugin : sorted) { if (requestBody == null) { return null; @@ -347,7 +358,8 @@ public ResponseObject updateResponse( String status, String httpMethodName, String path, - ResponseObject response) { + ResponseObject response + ) { for (OpenApiMapper plugin : sorted) { if (response == null) { return null; @@ -361,7 +373,8 @@ public ResponseObject updateResponse( public SecurityScheme updateSecurityScheme( Context context, Trait authTrait, - SecurityScheme securityScheme) { + SecurityScheme securityScheme + ) { for (OpenApiMapper plugin : sorted) { if (securityScheme == null) { return null; @@ -376,7 +389,8 @@ public Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { for (OpenApiMapper plugin : sorted) { if (requirement == null || requirement.isEmpty()) { return null; diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/CheckForPrefixHeaders.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/CheckForPrefixHeaders.java index 58ea9a1e9c7..a051052d4c0 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/CheckForPrefixHeaders.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/CheckForPrefixHeaders.java @@ -50,7 +50,8 @@ public void before(Context context, OpenApi.Builder builder) { private void checkForResponseHeaders( Context context, HttpBindingIndex bindingIndex, - ToShapeId shapeId) { + ToShapeId shapeId + ) { check(context, bindingIndex.getResponseBindings(shapeId, HttpBinding.Location.PREFIX_HEADERS)); } diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java index de1a325d8b8..cfe8a5e7523 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/mappers/SpecificationExtensionsMapper.java @@ -37,7 +37,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { operation.getExtensions().putAll(OpenApiUtils.getSpecificationExtensionsMap(context.getModel(), shape)); return operation; } diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AbstractRestProtocol.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AbstractRestProtocol.java index 51311b1feff..1511234db79 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AbstractRestProtocol.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AbstractRestProtocol.java @@ -106,7 +106,8 @@ abstract Schema createDocumentSchema( Context context, Shape operationOrError, List bindings, - MessageType messageType); + MessageType messageType + ); /** * Converts Smithy values in Node form to a data exchange format used by a protocol (e.g., XML). @@ -221,7 +222,8 @@ private Map createExamplesForMembersWithHttpTraits( Shape operationOrError, HttpBinding binding, MessageType type, - OperationShape operation) { + OperationShape operation + ) { if (operation == null && type == MessageType.ERROR) { return Collections.emptyMap(); } @@ -264,7 +266,8 @@ private Map createExamplesForMembersWithHttpTraits( private Map createErrorExamplesForMembersWithHttpTraits( Shape error, HttpBinding binding, - OperationShape operation) { + OperationShape operation + ) { Map examples = new TreeMap<>(); // unique numbering for unique example names in OpenAPI. @@ -302,7 +305,8 @@ private Map createBodyExamples( Shape operationOrError, List bindings, MessageType type, - OperationShape operation) { + OperationShape operation + ) { if (operation == null && type == MessageType.ERROR) { return Collections.emptyMap(); } @@ -340,7 +344,8 @@ private Map createBodyExamples( private Map createErrorBodyExamples( Shape error, List bindings, - OperationShape operation) { + OperationShape operation + ) { Map examples = new TreeMap<>(); // unique numbering for unique example names in OpenAPI. int uniqueNum = 1; @@ -476,7 +481,8 @@ private Map createHeaderParameters( List bindings, MessageType messageType, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { Map result = new TreeMap<>(); for (HttpBinding binding : bindings) { @@ -508,7 +514,8 @@ private Optional createRequestBody( Context context, HttpBindingIndex bindingIndex, EventStreamIndex eventStreamIndex, - OperationShape operation) { + OperationShape operation + ) { List payloadBindings = bindingIndex.getRequestBindings( operation, HttpBinding.Location.PAYLOAD); @@ -548,7 +555,8 @@ private Optional createRequestPayload( String mediaTypeRange, Context context, HttpBinding binding, - OperationShape operation) { + OperationShape operation + ) { // API Gateway validation requires that in-line schemas must be objects // or arrays. These schemas are synthesized as references so that // any schemas with string types will pass validation. @@ -574,7 +582,8 @@ private Optional createRequestDocument( String mediaType, Context context, HttpBindingIndex bindingIndex, - OperationShape operation) { + OperationShape operation + ) { List bindings = bindingIndex.getRequestBindings(operation, HttpBinding.Location.DOCUMENT); // If nothing is bound to the document, then no schema needs to be synthesized. @@ -611,7 +620,8 @@ private Map createResponses( Context context, HttpBindingIndex bindingIndex, EventStreamIndex eventStreamIndex, - OperationShape operation) { + OperationShape operation + ) { Map result = new TreeMap<>(); OperationIndex operationIndex = OperationIndex.of(context.getModel()); StructureShape output = operationIndex.expectOutputShape(operation); @@ -641,7 +651,8 @@ private void updateResponsesMapWithResponseStatusAndObject( EventStreamIndex eventStreamIndex, OperationShape operation, StructureShape shape, - Map responses) { + Map responses + ) { Shape operationOrError = shape.hasTrait(ErrorTrait.class) ? shape : operation; String statusCode = context.getOpenApiProtocol().getOperationResponseStatusCode(context, operationOrError); ResponseObject response = createResponse( @@ -660,7 +671,8 @@ private ResponseObject createResponse( EventStreamIndex eventStreamIndex, String statusCode, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { ResponseObject.Builder responseBuilder = ResponseObject.builder(); String contextName = context.getService().getContextualName(operationOrError); String responseName = stripNonAlphaNumericCharsIfNecessary(context, contextName); @@ -674,7 +686,8 @@ private ResponseObject createResponse( private Map createResponseHeaderParameters( Context context, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { List bindings = HttpBindingIndex.of(context.getModel()) .getResponseBindings(operationOrError, HttpBinding.Location.HEADER); MessageType type = !operationOrError.hasTrait(ErrorTrait.class) ? MessageType.RESPONSE : MessageType.ERROR; @@ -687,7 +700,8 @@ private void addResponseContent( EventStreamIndex eventStreamIndex, ResponseObject.Builder responseBuilder, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { List payloadBindings = bindingIndex.getResponseBindings( operationOrError, HttpBinding.Location.PAYLOAD); @@ -727,7 +741,8 @@ private void createResponsePayload( HttpBinding binding, ResponseObject.Builder responseBuilder, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { Objects.requireNonNull(mediaType, "Unable to determine response media type for " + operationOrError); // API Gateway validation requires that in-line schemas must be objects @@ -758,7 +773,8 @@ private MediaTypeObject getMediaTypeObject( Context context, Schema schema, Shape shape, - Function createSynthesizedName) { + Function createSynthesizedName + ) { if (!schema.getType().isPresent() && schema.getRef().isPresent()) { return MediaTypeObject.builder() .schema(Schema.builder().ref(schema.getRef().get()).build()) @@ -778,7 +794,8 @@ private void createResponseDocumentIfNeeded( HttpBindingIndex bindingIndex, ResponseObject.Builder responseBuilder, Shape operationOrError, - OperationShape operation) { + OperationShape operation + ) { List bindings = bindingIndex.getResponseBindings( operationOrError, HttpBinding.Location.DOCUMENT); diff --git a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java index c8b651aadec..13f5e7c073a 100644 --- a/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java +++ b/smithy-openapi/src/main/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1Protocol.java @@ -89,7 +89,8 @@ Schema createDocumentSchema( Context context, Shape operationOrError, List bindings, - MessageType message) { + MessageType message + ) { if (bindings.isEmpty()) { return Schema.builder().type("object").build(); } diff --git a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverterTest.java b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverterTest.java index 71f1c30914f..e939bf121fd 100644 --- a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverterTest.java +++ b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/OpenApiConverterTest.java @@ -332,7 +332,8 @@ public Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { return null; } } @@ -361,7 +362,8 @@ public Map> updateSecurity( Context context, Shape shape, SecuritySchemeConverter converter, - Map> requirement) { + Map> requirement + ) { return MapUtils.of("foo_baz", ListUtils.of()); } } diff --git a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java index 655e087f3eb..7ca94ddcf64 100644 --- a/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java +++ b/smithy-openapi/src/test/java/software/amazon/smithy/openapi/fromsmithy/protocols/AwsRestJson1ProtocolTest.java @@ -207,7 +207,8 @@ private static Stream protocolHeaderCases() { public void assertProtocolHeaders( String operationId, Set expectedRequestHeaders, - Set expectedResponseHeaders) { + Set expectedResponseHeaders + ) { Model model = Model.assembler() .addImport(getClass().getResource("rest-json-protocol-headers.smithy")) .discoverModels() @@ -252,7 +253,8 @@ public OperationObject updateOperation( OperationShape shape, OperationObject operation, String httpMethodName, - String path) { + String path + ) { this.capturedContext = context; return OpenApiMapper.super.updateOperation(context, shape, operation, httpMethodName, path); } diff --git a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestTestsTrait.java b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestTestsTrait.java index ebf58bd1cb0..ec91d558e77 100644 --- a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestTestsTrait.java +++ b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/HttpMalformedRequestTestsTrait.java @@ -29,7 +29,8 @@ public HttpMalformedRequestTestsTrait(List testCases) { + List testCases + ) { super(ID, sourceLocation); this.testCases = ListUtils.copyOf(testCases); } diff --git a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ParameterizedHttpMalformedRequestTestCase.java b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ParameterizedHttpMalformedRequestTestCase.java index 5ef83432c7d..838eee6fd55 100644 --- a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ParameterizedHttpMalformedRequestTestCase.java +++ b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ParameterizedHttpMalformedRequestTestCase.java @@ -129,7 +129,8 @@ public List generateTestCasesFromParameters() { private static HttpMalformedResponseDefinition interpolateResponse( HttpMalformedResponseDefinition response, - SimpleCodeWriter writer) { + SimpleCodeWriter writer + ) { HttpMalformedResponseDefinition.Builder responseBuilder = response.toBuilder().headers(formatHeaders(writer, response.getHeaders())); response.getBody() @@ -146,7 +147,8 @@ private static HttpMalformedResponseDefinition interpolateResponse( private static HttpMalformedRequestDefinition interpolateRequest( HttpMalformedRequestDefinition request, - SimpleCodeWriter writer) { + SimpleCodeWriter writer + ) { HttpMalformedRequestDefinition.Builder requestBuilder = request.toBuilder() .headers(formatHeaders(writer, request.getHeaders())) .queryParams(request.getQueryParams().stream().map(writer::format).collect(Collectors.toList())); diff --git a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ProtocolTestCaseValidator.java b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ProtocolTestCaseValidator.java index 3d479c8c027..cb905d84c82 100644 --- a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ProtocolTestCaseValidator.java +++ b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/ProtocolTestCaseValidator.java @@ -92,7 +92,8 @@ private List validateShape( Model model, OperationIndex operationIndex, Shape shape, - T trait) { + T trait + ) { List events = new ArrayList<>(); List testCases = getTestCases(trait); @@ -147,7 +148,8 @@ private NodeValidationVisitor createVisitor( Model model, Shape shape, int position, - String contextSuffix) { + String contextSuffix + ) { return NodeValidationVisitor.builder() .model(model) .eventShapeId(shape.getId()) diff --git a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/UniqueProtocolTestCaseIdValidator.java b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/UniqueProtocolTestCaseIdValidator.java index 686009bea17..65ab9b5668c 100644 --- a/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/UniqueProtocolTestCaseIdValidator.java +++ b/smithy-protocol-test-traits/src/main/java/software/amazon/smithy/protocoltests/traits/UniqueProtocolTestCaseIdValidator.java @@ -55,7 +55,8 @@ public List validate(Model model) { private void addTestCaseIdsToMap( Shape shape, List testCases, - Map> map) { + Map> map + ) { for (HttpMessageTestCase testCase : testCases) { map.computeIfAbsent(testCase.getId(), id -> new ArrayList<>()).add(shape); } @@ -64,7 +65,8 @@ private void addTestCaseIdsToMap( private void addMalformedRequestTestCaseIdsToMap( Shape shape, List testCases, - Map> map) { + Map> map + ) { for (HttpMalformedRequestTestCase testCase : testCases) { map.computeIfAbsent(testCase.getId(), id -> new ArrayList<>()).add(shape); } @@ -77,7 +79,8 @@ private void removeEntriesWithSingleValue(Map> map) { private List collectEvents( Map> requestIdsToTraits, Map> responseIdsToTraits, - Map> malformedRequestIdsToTraits) { + Map> malformedRequestIdsToTraits + ) { if (requestIdsToTraits.isEmpty() && responseIdsToTraits.isEmpty() && malformedRequestIdsToTraits.isEmpty()) { return Collections.emptyList(); } @@ -92,7 +95,8 @@ private List collectEvents( private void addValidationEvents( Map> conflicts, List mutableEvents, - ShapeId trait) { + ShapeId trait + ) { for (Map.Entry> entry : conflicts.entrySet()) { for (Shape shape : entry.getValue()) { mutableEvents.add(error(shape, diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/analysis/OperationContextParamsChecker.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/analysis/OperationContextParamsChecker.java index 80f4b2a88d4..599b9b12895 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/analysis/OperationContextParamsChecker.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/analysis/OperationContextParamsChecker.java @@ -56,7 +56,8 @@ private OperationContextParamsChecker() { public static LinterResult lint( OperationContextParamDefinition paramDefinition, OperationShape operationShape, - Model model) { + Model model + ) { JmespathExpression path = JmespathExpression.parse(paramDefinition.getPath()); StructureShape input = OperationIndex.of(model).expectInputShape(operationShape); return path.lint(createCurrentNodeFromShape(input, model)); @@ -65,7 +66,8 @@ public static LinterResult lint( public static Optional inferParameterType( OperationContextParamDefinition paramDefinition, OperationShape operationShape, - Model model) { + Model model + ) { RuntimeType runtimeType = lint(paramDefinition, operationShape, model).getReturnType(); switch (runtimeType) { case BOOLEAN: diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/EndpointComponentFactory.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/EndpointComponentFactory.java index 1855027648e..6dec776cb36 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/EndpointComponentFactory.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/EndpointComponentFactory.java @@ -56,7 +56,8 @@ public interface EndpointComponentFactory { static EndpointComponentFactory createServiceFactory( Map builtIns, Map libraryFunctions, - List authSchemeValidators) { + List authSchemeValidators + ) { return new EndpointComponentFactory() { @Override public boolean hasBuiltIn(String name) { diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/error/RuleError.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/error/RuleError.java index fd0572c42fa..8207dd475b0 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/error/RuleError.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/error/RuleError.java @@ -82,7 +82,8 @@ public static void context(String message, FromSourceLocation sourceLocation, Ru public static T context( String message, FromSourceLocation sourceLocation, - Evaluator runnable) throws RuleError { + Evaluator runnable + ) throws RuleError { try { return runnable.call(); } catch (SourceException ex) { diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/FunctionNode.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/FunctionNode.java index 474a392673c..c3b98048ccf 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/FunctionNode.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/FunctionNode.java @@ -68,7 +68,8 @@ public static FunctionNode ofExpressions(String functionName, ToExpression... ar public static FunctionNode ofExpressions( String functionName, FromSourceLocation sourceLocation, - ToExpression... arguments) { + ToExpression... arguments + ) { return builder() .sourceLocation(sourceLocation) .name(StringNode.from(functionName)) diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/Substring.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/Substring.java index d725dbeeae8..f0c0e237844 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/Substring.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/expressions/functions/Substring.java @@ -47,7 +47,8 @@ public static Substring ofExpressions( ToExpression expression, ToExpression startIndex, ToExpression stopIndex, - ToExpression reverse) { + ToExpression reverse + ) { return DEFINITION.createFunction(FunctionNode.ofExpressions(ID, expression, startIndex, stopIndex, reverse)); } diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/traits/EndpointTestsTraitValidator.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/traits/EndpointTestsTraitValidator.java index d90f0d3f18f..1761769ee81 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/traits/EndpointTestsTraitValidator.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/traits/EndpointTestsTraitValidator.java @@ -81,7 +81,8 @@ private List validateOperationInput( Model model, ServiceShape serviceShape, StructureShape inputShape, - EndpointTestOperationInput testOperationInput) { + EndpointTestOperationInput testOperationInput + ) { NodeValidationVisitor validator = NodeValidationVisitor.builder() .model(model) .value(testOperationInput.getOperationParams()) diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/AuthSchemeValidator.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/AuthSchemeValidator.java index 913671b71f0..8b2ee6da6e0 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/AuthSchemeValidator.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/AuthSchemeValidator.java @@ -31,5 +31,6 @@ public interface AuthSchemeValidator extends Predicate { List validateScheme( Map authScheme, FromSourceLocation sourceLocation, - BiFunction emitter); + BiFunction emitter + ); } diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetAuthSchemesValidator.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetAuthSchemesValidator.java index 483fbfb389e..1c678f82bd2 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetAuthSchemesValidator.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetAuthSchemesValidator.java @@ -102,7 +102,8 @@ public Stream visitEndpoint(Endpoint endpoint) { private Optional validateAuthSchemeName( Map authScheme, - FromSourceLocation sourceLocation) { + FromSourceLocation sourceLocation + ) { if (!authScheme.containsKey(NAME) || !authScheme.get(NAME).asStringLiteral().isPresent()) { return Optional.of(error(serviceShape, sourceLocation, @@ -115,7 +116,8 @@ private Optional validateAuthSchemeName( private List validateAuthScheme( String schemeName, Map authScheme, - FromSourceLocation sourceLocation) { + FromSourceLocation sourceLocation + ) { List events = new ArrayList<>(); BiFunction emitter = getEventEmitter(); diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetBuiltInValidator.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetBuiltInValidator.java index 1c4edf92f52..430412c1d1f 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetBuiltInValidator.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetBuiltInValidator.java @@ -78,7 +78,8 @@ private Optional validateBuiltIn( ServiceShape serviceShape, String builtInName, FromSourceLocation source, - String... eventIdSuffixes) { + String... eventIdSuffixes + ) { if (!EndpointRuleSet.hasBuiltIn(builtInName)) { return Optional.of(error(serviceShape, source, diff --git a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetParameterValidator.java b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetParameterValidator.java index aa0be7ff2ec..a7f530df675 100644 --- a/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetParameterValidator.java +++ b/smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/validators/RuleSetParameterValidator.java @@ -81,7 +81,8 @@ public List validate(Model model) { private Pair, Map> validateAndExtractParameters( Model model, ServiceShape serviceShape, - Set containedOperations) { + Set containedOperations + ) { List errors = new ArrayList<>(); Map endpointParams = new HashMap<>(); @@ -180,7 +181,8 @@ private Pair, Map> validateAndExtractPa private List validateParametersMatching( ServiceShape serviceShape, Parameters ruleSetParams, - Map modelParams) { + Map modelParams + ) { List errors = new ArrayList<>(); Set matchedParams = new HashSet<>(); for (Parameter parameter : ruleSetParams) { @@ -229,7 +231,8 @@ private List validateTestsParameters( TopDownIndex topDownIndex, ServiceShape serviceShape, EndpointTestsTrait trait, - EndpointRuleSet ruleSet) { + EndpointRuleSet ruleSet + ) { List errors = new ArrayList<>(); Set rulesetParamNames = new HashSet<>(); Map> testSuiteParams = extractTestSuiteParameters(model, @@ -292,7 +295,8 @@ private Map> extractTestSuiteParameters( TopDownIndex topDownIndex, ServiceShape serviceShape, EndpointRuleSet ruleSet, - EndpointTestsTrait trait) { + EndpointTestsTrait trait + ) { Map> params = new HashMap<>(); for (EndpointTestCase testCase : trait.getTestCases()) { List testParams = new ArrayList<>(); @@ -371,7 +375,8 @@ private ValidationEvent parameterError( Shape shape, FromSourceLocation sourceLocation, String id, - String message) { + String message + ) { return error(shape, sourceLocation, message).toBuilder().id(getName() + "." + id).build(); } } diff --git a/smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/SmokeTestCaseValidator.java b/smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/SmokeTestCaseValidator.java index b42fc3bdf44..723a3a5f3ab 100644 --- a/smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/SmokeTestCaseValidator.java +++ b/smithy-smoke-test-traits/src/main/java/software/amazon/smithy/smoketests/traits/SmokeTestCaseValidator.java @@ -98,7 +98,8 @@ private NodeValidationVisitor createVisitor( Model model, Shape shape, String caseId, - String contextSuffix) { + String contextSuffix + ) { return NodeValidationVisitor.builder() .model(model) .eventShapeId(shape.getId()) diff --git a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/BracketFormatter.java b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/BracketFormatter.java index c9b976a22b4..59f99f849a2 100644 --- a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/BracketFormatter.java +++ b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/BracketFormatter.java @@ -25,14 +25,16 @@ final class BracketFormatter { static Function> extractor( Function visitor, - Function> mapper) { + Function> mapper + ) { return extractor(visitor, mapper, TreeCursor::children); } static Function> extractor( Function visitor, Function> mapper, - Function> childrenSupplier) { + Function> childrenSupplier + ) { return (cursor) -> childrenSupplier.apply(cursor) .flatMap(c -> { TreeType type = c.getTree().getType(); @@ -62,7 +64,8 @@ static Function> siblingChildrenSupplier() { // on a single line, they are comma separated. If not, they are split onto multiple lines with no commas. static Function> extractByType( TreeType childType, - Function visitor) { + Function visitor + ) { return extractor(visitor, byTypeMapper(childType)); } diff --git a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/CapturedToken.java b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/CapturedToken.java index c33c06312ea..48a0904123a 100644 --- a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/CapturedToken.java +++ b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/CapturedToken.java @@ -47,7 +47,8 @@ private CapturedToken( CharSequence lexeme, String stringContents, Number numberValue, - String errorMessage) { + String errorMessage + ) { this.token = Objects.requireNonNull(token, "Missing required token"); this.lexeme = Objects.requireNonNull(lexeme, "Missing required lexeme"); this.filename = filename == null ? SourceLocation.none().getFilename() : filename; diff --git a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/FormatVisitor.java b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/FormatVisitor.java index 09d9af1c0a8..7eb18a0bd0c 100644 --- a/smithy-syntax/src/main/java/software/amazon/smithy/syntax/FormatVisitor.java +++ b/smithy-syntax/src/main/java/software/amazon/smithy/syntax/FormatVisitor.java @@ -696,7 +696,8 @@ private Doc section(TreeCursor cursor, TreeType childType) { private static Doc formatNodeObjectKvp( TreeCursor cursor, Function keyVisitor, - Function valueVisitor) { + Function valueVisitor + ) { // Since text blocks span multiple lines, when they are the NODE_VALUE for NODE_OBJECT_KVP, // they have to be indented. Since we only format valid models, NODE_OBJECT_KVP is guaranteed to // have a NODE_VALUE child. diff --git a/smithy-syntax/src/test/java/software/amazon/smithy/syntax/TreeTypeTest.java b/smithy-syntax/src/test/java/software/amazon/smithy/syntax/TreeTypeTest.java index d6aa33136a1..ec80fc06d17 100644 --- a/smithy-syntax/src/test/java/software/amazon/smithy/syntax/TreeTypeTest.java +++ b/smithy-syntax/src/test/java/software/amazon/smithy/syntax/TreeTypeTest.java @@ -1842,7 +1842,8 @@ public void invalidComment() { private static void rootAndChildTypesEqual( TokenTree actualTree, TreeType expectedRoot, - TreeType... expectedChildren) { + TreeType... expectedChildren + ) { assertEquals(expectedRoot, actualTree.getType()); String actual = actualTree.getChildren().stream().map(t -> t.getType().toString()).collect(Collectors.joining(",")); diff --git a/smithy-trait-codegen/build.gradle.kts b/smithy-trait-codegen/build.gradle.kts index 9551afd8bba..2ef7a50de61 100644 --- a/smithy-trait-codegen/build.gradle.kts +++ b/smithy-trait-codegen/build.gradle.kts @@ -31,7 +31,7 @@ sourceSets { spotless { java { - targetExclude("build/integ") + targetExclude("build/**/*.*") } } } diff --git a/smithy-trait-codegen/src/it/java/software/amazon/smithy/traitcodegen/test/LoadsFromModelTest.java b/smithy-trait-codegen/src/it/java/software/amazon/smithy/traitcodegen/test/LoadsFromModelTest.java index 64612313e44..c940dc8fc38 100644 --- a/smithy-trait-codegen/src/it/java/software/amazon/smithy/traitcodegen/test/LoadsFromModelTest.java +++ b/smithy-trait-codegen/src/it/java/software/amazon/smithy/traitcodegen/test/LoadsFromModelTest.java @@ -377,7 +377,8 @@ static Stream loadsModelTests() { void executeTests( String resourceFile, Class traitClass, - Map valueChecks) { + Map valueChecks + ) { Model result = Model.assembler() .discoverModels(getClass().getClassLoader()) .addImport(Objects.requireNonNull(getClass().getResource(resourceFile))) diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegen.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegen.java index 5e9bbe1dfeb..64c1472a05c 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegen.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegen.java @@ -64,7 +64,8 @@ private TraitCodegen( Model model, TraitCodegenSettings settings, FileManifest fileManifest, - PluginContext pluginContext) { + PluginContext pluginContext + ) { this.model = Objects.requireNonNull(model); this.settings = Objects.requireNonNull(settings); this.fileManifest = Objects.requireNonNull(fileManifest); diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenContext.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenContext.java index af75c9cf500..4090b626e2e 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenContext.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenContext.java @@ -32,7 +32,8 @@ public final class TraitCodegenContext implements CodegenContext integrations) { + List integrations + ) { this.model = model; this.settings = settings; this.symbolProvider = symbolProvider; diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenSettings.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenSettings.java index 625daf54a0f..d6edb6a920f 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenSettings.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenSettings.java @@ -52,7 +52,8 @@ public final class TraitCodegenSettings { String packageName, String smithyNamespace, List headerLines, - List excludeTags) { + List excludeTags + ) { this.packageName = Objects.requireNonNull(packageName); if (packageName.startsWith(SMITHY_MODEL_NAMESPACE)) { throw new IllegalArgumentException("The `software.amazon.smithy` package namespace is reserved."); diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenUtils.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenUtils.java index 8631a563281..353ec50ddd4 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenUtils.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/TraitCodegenUtils.java @@ -127,7 +127,8 @@ public static boolean isJavaStringList(Shape shape, SymbolProvider symbolProvide public static String mapNamespace( String rootSmithyNamespace, String shapeNamespace, - String packageNamespace) { + String packageNamespace + ) { if (!shapeNamespace.startsWith(rootSmithyNamespace)) { throw new IllegalArgumentException("Cannot relativize non-nested namespaces " + "Root: " + rootSmithyNamespace + " Nested: " + shapeNamespace + "."); diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/BuilderGenerator.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/BuilderGenerator.java index 3271bfdee06..3a63f94e9fc 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/BuilderGenerator.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/BuilderGenerator.java @@ -65,7 +65,8 @@ final class BuilderGenerator implements Runnable { Symbol symbol, SymbolProvider symbolProvider, Shape baseShape, - Model model) { + Model model + ) { this.writer = writer; this.symbol = symbol; this.symbolProvider = symbolProvider; @@ -386,7 +387,8 @@ private static final class DefaultInitializerGenerator extends ShapeVisitor.Data TraitCodegenWriter writer, Model model, SymbolProvider symbolProvider, - MemberShape member) { + MemberShape member + ) { this.writer = writer; this.model = model; this.symbolProvider = symbolProvider; diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ConstructorGenerator.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ConstructorGenerator.java index 4fc6ca05f81..4d77213890f 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ConstructorGenerator.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ConstructorGenerator.java @@ -52,7 +52,8 @@ final class ConstructorGenerator extends TraitVisitor implements Runnable TraitCodegenWriter writer, Symbol symbol, Shape shape, - SymbolProvider symbolProvider) { + SymbolProvider symbolProvider + ) { this.writer = writer; this.symbol = symbol; this.shape = shape; diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/EnumShapeGenerator.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/EnumShapeGenerator.java index 406fd302f27..fe5afa063af 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/EnumShapeGenerator.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/EnumShapeGenerator.java @@ -47,7 +47,8 @@ public void writeEnum( Shape enumShape, SymbolProvider provider, TraitCodegenWriter writer, - Model model) { + Model model + ) { writeEnum(enumShape, provider, writer, model, true); } @@ -65,7 +66,8 @@ public void writeEnum( SymbolProvider provider, TraitCodegenWriter writer, Model model, - boolean isStandaloneClass) { + boolean isStandaloneClass + ) { Symbol enumSymbol = provider.toSymbol(enumShape); writer.pushState(new ClassSection(enumShape)) .putContext("standalone", isStandaloneClass) diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/FromNodeGenerator.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/FromNodeGenerator.java index 199d07b3792..8c714c7650c 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/FromNodeGenerator.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/FromNodeGenerator.java @@ -55,7 +55,8 @@ final class FromNodeGenerator extends TraitVisitor implements Runnable { Symbol symbol, Shape shape, SymbolProvider symbolProvider, - Model model) { + Model model + ) { this.writer = writer; this.symbol = symbol; this.shape = shape; diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ProviderGenerator.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ProviderGenerator.java index ed5d2e8cef3..382036fa77b 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ProviderGenerator.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/generators/ProviderGenerator.java @@ -47,7 +47,8 @@ final class ProviderGenerator implements Runnable { Model model, Shape shape, SymbolProvider provider, - Symbol traitSymbol) { + Symbol traitSymbol + ) { this.writer = writer; this.model = model; this.shape = shape; diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/annotations/AnnotationIntegration.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/annotations/AnnotationIntegration.java index 911775de30d..08fdfc30142 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/annotations/AnnotationIntegration.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/annotations/AnnotationIntegration.java @@ -29,7 +29,8 @@ public List runBefore() { @Override public List> interceptors( - TraitCodegenContext codegenContext) { + TraitCodegenContext codegenContext + ) { return ListUtils.of( new SmithyGeneratedAnnotationInterceptor(), new DeprecatedAnnotationInterceptor(), diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/core/CoreIntegration.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/core/CoreIntegration.java index 29369f34306..d5e3e535c5a 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/core/CoreIntegration.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/core/CoreIntegration.java @@ -52,7 +52,8 @@ public byte priority() { public SymbolProvider decorateSymbolProvider( Model model, TraitCodegenSettings settings, - SymbolProvider symbolProvider) { + SymbolProvider symbolProvider + ) { return new SymbolProvider() { @Override public Symbol toSymbol(Shape shape) { @@ -72,7 +73,8 @@ public String toMemberName(MemberShape shape) { @Override public List> interceptors( - TraitCodegenContext codegenContext) { + TraitCodegenContext codegenContext + ) { return ListUtils.of(new JavadocFormatterInterceptor()); } diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/idref/IdRefDecoratorIntegration.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/idref/IdRefDecoratorIntegration.java index c73af25c1ae..89e44b37b94 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/idref/IdRefDecoratorIntegration.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/idref/IdRefDecoratorIntegration.java @@ -45,7 +45,8 @@ public byte priority() { public SymbolProvider decorateSymbolProvider( Model model, TraitCodegenSettings settings, - SymbolProvider symbolProvider) { + SymbolProvider symbolProvider + ) { return new SymbolProvider() { @Override public Symbol toSymbol(Shape shape) { diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/javadoc/JavaDocIntegration.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/javadoc/JavaDocIntegration.java index c695810a51b..6cebb9bd567 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/javadoc/JavaDocIntegration.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/integrations/javadoc/JavaDocIntegration.java @@ -30,7 +30,8 @@ public String name() { @Override public List> interceptors( - TraitCodegenContext codegenContext) { + TraitCodegenContext codegenContext + ) { return ListUtils.of( new JavaDocInjectorInterceptor(), new ExternalDocumentationInterceptor(), diff --git a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/writer/TraitCodegenWriter.java b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/writer/TraitCodegenWriter.java index 0a17b20ec51..b8132f4c477 100644 --- a/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/writer/TraitCodegenWriter.java +++ b/smithy-trait-codegen/src/main/java/software/amazon/smithy/traitcodegen/writer/TraitCodegenWriter.java @@ -54,7 +54,8 @@ public class TraitCodegenWriter extends SymbolWriter, Object> valueGetter, char formatter, - Supplier errorMessage) { + Supplier errorMessage + ) { return (sink, writer) -> { Object value = valueGetter.apply(writer); String result = writer.applyFormatter(formatter, value); diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeInterceptor.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeInterceptor.java index 478f6b97e8c..c747d89f773 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeInterceptor.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/CodeInterceptor.java @@ -78,7 +78,8 @@ default boolean isIntercepted(S section) { */ static > CodeInterceptor appender( Class type, - BiConsumer appender) { + BiConsumer appender + ) { return new Appender() { @Override public void append(W writer, S section) { @@ -156,7 +157,8 @@ default void write(W writer, String previousText, S section) { */ static > CodeInterceptor forName( String sectionName, - BiConsumer consumer) { + BiConsumer consumer + ) { return new CodeInterceptor() { @Override public Class sectionType() { 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 820bfa050d6..9e8a3d0e08e 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 @@ -242,7 +242,8 @@ public CodeWriter openBlock( String textAfterNewline, Object arg1, Object arg2, - Runnable f) { + Runnable f + ) { super.openBlock(textBeforeNewline, textAfterNewline, arg1, arg2, f); return this; } @@ -254,7 +255,8 @@ public CodeWriter openBlock( Object arg1, Object arg2, Object arg3, - Runnable f) { + Runnable f + ) { super.openBlock(textBeforeNewline, textAfterNewline, arg1, arg2, arg3, f); return this; } @@ -267,7 +269,8 @@ public CodeWriter openBlock( Object arg2, Object arg3, Object arg4, - Runnable f) { + Runnable f + ) { super.openBlock(textBeforeNewline, textAfterNewline, arg1, arg2, arg3, arg4, f); return this; } @@ -281,7 +284,8 @@ public CodeWriter openBlock( Object arg3, Object arg4, Object arg5, - Runnable f) { + Runnable f + ) { super.openBlock(textBeforeNewline, textAfterNewline, arg1, arg2, arg3, arg4, arg5, f); return this; } diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/DefaultBuilderRef.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/DefaultBuilderRef.java index fafe59bf750..18886b101b2 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/DefaultBuilderRef.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/DefaultBuilderRef.java @@ -30,7 +30,8 @@ final class DefaultBuilderRef implements BuilderRef { Supplier ctor, Function copyCtor, Function immutableWrapper, - Supplier emptyCtorOptimization) { + Supplier emptyCtorOptimization + ) { this.ctor = ctor; this.copyCtor = copyCtor; this.immutableWrapper = immutableWrapper; diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java index a6a094ce495..40f16abe031 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/IoUtils.java @@ -256,7 +256,8 @@ public static int runCommand( Path directory, InputStream input, Appendable output, - Map env) { + Map env + ) { ProcessBuilder processBuilder = new ProcessBuilder(args) .directory(Objects.requireNonNull(directory.toFile(), "Process directory cannot be null")) .redirectErrorStream(true); diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/MapUtils.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/MapUtils.java index a6befddd826..72372846274 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/MapUtils.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/MapUtils.java @@ -199,7 +199,8 @@ public static Map of( K k5, V v5, K k6, - V v6) { + V v6 + ) { Map result = new HashMap<>(6); result.put(k1, v1); result.put(k2, v2); @@ -247,7 +248,8 @@ public static Map of( K k6, V v6, K k7, - V v7) { + V v7 + ) { Map result = new HashMap<>(7); result.put(k1, v1); result.put(k2, v2); @@ -300,7 +302,8 @@ public static Map of( K k7, V v7, K k8, - V v8) { + V v8 + ) { Map result = new HashMap<>(8); result.put(k1, v1); result.put(k2, v2); @@ -358,7 +361,8 @@ public static Map of( K k8, V v8, K k9, - V v9) { + V v9 + ) { Map result = new HashMap<>(9); result.put(k1, v1); result.put(k2, v2); @@ -421,7 +425,8 @@ public static Map of( K k9, V v9, K k10, - V v10) { + V v10 + ) { Map result = new HashMap<>(10); result.put(k1, v1); result.put(k2, v2); @@ -490,7 +495,8 @@ public static Map ofEntries(Map.Entry... @SuppressWarnings("unchecked") public static Collector> toUnmodifiableMap( Function keyMapper, - Function valueMapper) { + Function valueMapper + ) { return Collectors.collectingAndThen( Collectors.toMap( Objects.requireNonNull(keyMapper, "keyMapper"), diff --git a/smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java b/smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java index ef3ac4a28dc..923668f1303 100644 --- a/smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java +++ b/smithy-utils/src/main/java/software/amazon/smithy/utils/StringUtils.java @@ -1181,7 +1181,8 @@ public static String wrap( final String str, final int wrapLength, final String newLineStr, - final boolean wrapLongWords) { + final boolean wrapLongWords + ) { return wrap(str, wrapLength, newLineStr, wrapLongWords, " "); } @@ -1283,7 +1284,8 @@ public static String wrap( int wrapLength, String newLineStr, final boolean wrapLongWords, - String wrapOn) { + String wrapOn + ) { if (str == null) { return null; }