-
Notifications
You must be signed in to change notification settings - Fork 853
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
S3Presigner.Builder returns SdkPresigner #4604
Comments
@KevinAtSesam I'll move this to the Java SDK v2 repository. |
@KevinAtSesam I cannot reproduce the issue using Java, do you have a self contained example that we can use to reproduce? In particular I would be interested in the dependencies that you are using. For what's worth I tested using this Java class package software.amazon.awssdk.test;
import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3.presigner.S3Presigner;
public class App {
public static S3Presigner getAwsS3PreSigner() {
AwsBasicCredentials awsCredentials = AwsBasicCredentials.create("foo", "bar");
return S3Presigner
.builder()
.region(Region.ME_SOUTH_1)
.credentialsProvider(StaticCredentialsProvider.create(awsCredentials))
.build();
}
} And these dependencies in the <dependencies>
<dependency>
<groupId>software.amazon.awssdk</groupId>
<artifactId>s3</artifactId>
<version>2.21.1</version>
</dependency>
</dependencies>
|
Just to complement @sugmanue comment, our guess is that you are using a version of core that is different than You can check this by printing your dependency tree, in maven the command is
|
@KevinAtSesam we were able to reproduce the issue with a local Scala project. Looks like a bug in the Scala compiler that does not like how we are defining our interfaces in Java. Regardless we have a fix for it in #4606 which is under review by the team and does the trick for us. |
I have added a comment to this similar issue open in the Scala repository with a small test case to reproduce the bug. |
|
Describe the bug
Take this Scala 2.13 code:
With AWS SDK
2.20.162
, this compiles properly. With AWS SDK2.21.1
this doesn't compile, causing a typing error:Expected Behavior
I expect that
2.21.1
is backwards compatible with2.20.162
and that the builder returns the proper implementation. This is likely caused by.region()
and/or.credentialsProvider()
because without those two statements, it does still compile properly.Current Behavior
Compile-error because the wrong type is returned by
.build()
. Do mind, that other SdkBuilder instances like SNS or CloudWatch all compile as expected.Reproduction Steps
Feel free to take the code from above. My apologies for giving you this example in Scala 2.13
Possible Solution
No response
Additional Information/Context
No response
AWS Java SDK version used
2.21.1
JDK version used
OpenJDK Runtime Environment Corretto-21.0.0.35.1 (build 21+35-LTS)
Operating System and version
Fedora Linux 38
The text was updated successfully, but these errors were encountered: