New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
S3CrtAsyncClientBuilder.build() should return S3CrtAsyncClient #5057
Comments
@brwebb can you give us more context about your use case? How would you use the |
Sure. The use case is that I want to upload a java Let's assume we want to use the AWS CRT-based S3 Client. As a developer, I know that the normal
In that sample code, the method signature allows a caller is allowed to pass in an object of type If the method signature requires |
To add to this: the current sample in the aws-sdk-java-v2 for async putobject does not even work without changing the code something similar to this:
|
Describe the bug
I am unable to build an instance of type
S3CrtAsyncClient
The document has the following example:
S3AsyncClient s3AsyncClient = S3AsyncClient.crtCreate();
This will indeed build an instance of
S3CrtAsyncClient
, however the return type ofcrtCreate()
isS3AsyncClient
, notS3CrtAsyncClient
.So I can't have code that requires
S3CrtAsyncClient
without manually casting.Expected Behavior
I was hoping to have the signature be
S3CrtAsyncClient S3CrtAsyncClientBuilder.build();
instead of the current code
S3AsyncClient S3CrtAsyncClientBuilder.build();
Current Behavior
S3CrtAsyncClient S3CrtAsyncClientBuilder.build();
See https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3CrtAsyncClientBuilder.java#L339
Reproduction Steps
S3CrtAsyncClient s3AsyncClient = S3AsyncClient.crtCreate();
fails to compile.
Possible Solution
Change
S3AsyncClient S3CrtAsyncClientBuilder.build();
to
S3CrtAsyncClient S3CrtAsyncClientBuilder.build();
here https://github.com/aws/aws-sdk-java-v2/blob/master/services/s3/src/main/java/software/amazon/awssdk/services/s3/S3CrtAsyncClientBuilder.java#L339
Additional Information/Context
No response
AWS Java SDK version used
2.23.4
JDK version used
openjdk 11.0.21 2023-10-17 OpenJDK Runtime Environment Homebrew (build 11.0.21+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.21+0, mixed mode)
Operating System and version
MacOS
The text was updated successfully, but these errors were encountered: