You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Smithy-Dafny has many hard-coded checks for this,
to prevent consumers from getting a Class Not Found exception or it's .NET allegory.
But those hard-coded checks are not applied on the "all error" converter.
For a list of those hard-coded checks:
grep -n "InvalidEndpoint" codegen/**/*.java
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/AwsSdkTypeConversionCodegen.java:172: // InvalidEndpointException does not exist in v2 of the sdk
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/AwsSdkTypeConversionCodegen.java:173: if (sdkErrorType.endsWith("InvalidEndpointException")) {
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/AwsSdkTypeConversionCodegen.java:211: modeledErrorShapeId.getName().endsWith("InvalidEndpointException")
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java:1951: // InvalidEndpointException was deprecated in v3 of the dynamodb sdk for net
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithydotnet/TypeConversionCodegen.java:1955: "Amazon.DynamoDBv2.Model.InvalidEndpointException"
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ShimV2.java:216: // InvalidEndpointException was removed in SDK V2
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ShimV2.java:217: if (typeForShape.toString().endsWith("InvalidEndpointException")) {
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ToDafnyAwsV2.java:128: // InvalidEndpointException does not exist in SDK V2
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ToDafnyAwsV2.java:132: .contains("com.amazonaws.dynamodb#InvalidEndpointException")
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ToNativeAwsV2.java:152: // InvalidEndpointException does not exist in SDK V2
codegen/smithy-dafny-codegen/src/main/java/software/amazon/polymorph/smithyjava/generator/awssdk/v2/ToNativeAwsV2.java:156: .contains("com.amazonaws.dynamodb#InvalidEndpointException")
Consequence
The result of this miss MAY be a risk to Java consumers.
For Errors, the Java conversion logic uses overloaded methods,
all with the same name, Error,
relying on type refinement/checking to invoke the correct method.
Because there will be no refinement for InvalidEndpoint,
the Error conversion method MAY recursively call the generic method.
Alternatively, it may end up at Opaque.
I am not certain.
InvalidEndpoint present in SDK Models but not in packages
The InvalidEndpointException is occasionally present in AWS SDK Models,
such as DynamoDB's (link to shape in TestModel).
But the AWS SDK for Java V2 does not include this Exception.
It is hard to find linkable evidence,
but you can check the JavaDoc for the DDB Package's Model section
and see that it is not present.
Smithy-Dafny has many hard-coded checks for this,
to prevent consumers from getting a Class Not Found exception or it's .NET allegory.
But those hard-coded checks are not applied on the "all error" converter.
For a list of those hard-coded checks:
Consequence
The result of this miss MAY be a risk to Java consumers.
For Errors, the Java conversion logic uses overloaded methods,
all with the same name,
Error
,relying on type refinement/checking to invoke the correct method.
Because there will be no refinement for
InvalidEndpoint
,the
Error
conversion method MAY recursively call the generic method.Alternatively, it may end up at Opaque.
I am not certain.
See https://github.com/aws/aws-cryptographic-material-providers-library/pull/947/files#diff-010f7297293a5a90e7b1dcf3e0ab959b6410315786912f3ecafb87fc5627a140 for an example that added this problematic issue.
The text was updated successfully, but these errors were encountered: