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
Currently GreengrassException builder returns an object with incorrect type. It returns AwsServiceException instead of GreengrassException.
Which in turn forces unnecessary casting (GreengrassException) GreengrassException.builder().build() and doesn't seem in line what other exceptions do.
Regression Issue
Select this option if this issue appears to be a regression.
incompatible types: software.amazon.awssdk.awscore.exception.AwsServiceException cannot be converted to software.amazon.awssdk.services.greengrass.model.GreengrassException
Reproduction Steps
Given the actual behavior produces compilation error, the following code should be sufficient for reproduction:
I don't have much experience with generated code, but looking at the BadRequestException from the same package, there's a difference in Builder interfaces:
BadRequestException:
public interface Builder extends SdkPojo, CopyableBuilder<Builder, BadRequestException>, GreengrassException.Builder
vs
GreengrassException:
protected static class BuilderImpl extends AwsServiceException.BuilderImpl implements Builder
Note that BadRequestException builder works correctly, when built it returns BadRequestException and not GreengrassException, the parent one.
After looking a bit deeper, CopyableBuilder is what provides T build() method, which makes BadRequestException to return correct type.
Additional Information/Context
No response
AWS Java SDK version used
2.28.19
JDK version used
openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-120.04, mixed mode, sharing)
Operating System and version
Ubuntu 20.04.6 LTS
The text was updated successfully, but these errors were encountered:
Describe the bug
Currently GreengrassException builder returns an object with incorrect type. It returns
AwsServiceException
instead ofGreengrassException
.Which in turn forces unnecessary casting
(GreengrassException) GreengrassException.builder().build()
and doesn't seem in line what other exceptions do.Regression Issue
Expected Behavior
to compile without an error
Current Behavior
produces a compilation error
Reproduction Steps
Given the actual behavior produces compilation error, the following code should be sufficient for reproduction:
Possible Solution
I don't have much experience with generated code, but looking at the
BadRequestException
from the same package, there's a difference in Builder interfaces:BadRequestException:
vs
GreengrassException:
Note that
BadRequestException
builder works correctly, when built it returnsBadRequestException
and notGreengrassException
, the parent one.After looking a bit deeper,
CopyableBuilder
is what providesT build()
method, which makesBadRequestException
to return correct type.Additional Information/Context
No response
AWS Java SDK version used
2.28.19
JDK version used
openjdk version "17.0.9" 2023-10-17 OpenJDK Runtime Environment (build 17.0.9+9-Ubuntu-120.04) OpenJDK 64-Bit Server VM (build 17.0.9+9-Ubuntu-120.04, mixed mode, sharing)
Operating System and version
Ubuntu 20.04.6 LTS
The text was updated successfully, but these errors were encountered: