Skip to content

Commit 87aaa72

Browse files
Fix CrossRegionS3Client generation consistency. (#329)
1 parent b0717ca commit 87aaa72

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

spring-cloud-aws-s3-parent/spring-cloud-aws-s3-codegen/src/main/java/io/awspring/cloud/s3/codegen/CrossRegionS3ClientGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ private static void addOverriddenMethods(ClassOrInterfaceDeclaration crossRegion
8787
TypeSolver typeSolver = new ClassLoaderTypeSolver(CrossRegionS3ClientGenerator.class.getClassLoader());
8888
ResolvedReferenceTypeDeclaration resolvedReferenceTypeDeclaration = typeSolver
8989
.solveType(S3Client.class.getName());
90-
resolvedReferenceTypeDeclaration.getAllMethods().stream().sorted(Comparator.comparing(MethodUsage::getName))
91-
.forEach(method -> {
90+
resolvedReferenceTypeDeclaration.getAllMethods().stream()
91+
.sorted(Comparator.comparing(MethodUsage::getSignature)).forEach(method -> {
9292
if (isRegionSpecific(method) && isCanonical(method)) {
9393
MethodDeclaration methodDeclaration = crossRegionS3Client.addMethod(method.getName(),
9494
Modifier.Keyword.PUBLIC);

spring-cloud-aws-s3-parent/spring-cloud-aws-s3-cross-region-client/src/main/java/io/awspring/cloud/s3/crossregion/CrossRegionS3Client.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ public software.amazon.awssdk.services.s3.model.GetBucketWebsiteResponse getBuck
330330
}
331331

332332
@Override
333-
public <ReturnT> ReturnT getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest p0, software.amazon.awssdk.core.sync.ResponseTransformer<software.amazon.awssdk.services.s3.model.GetObjectResponse, ReturnT> p1) throws AwsServiceException, SdkClientException {
334-
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObject(p0, p1));
333+
public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse> getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest p0) throws AwsServiceException, SdkClientException {
334+
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObject(p0));
335335
}
336336

337337
@Override
@@ -340,8 +340,8 @@ public software.amazon.awssdk.services.s3.model.GetObjectResponse getObject(soft
340340
}
341341

342342
@Override
343-
public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectResponse> getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest p0) throws AwsServiceException, SdkClientException {
344-
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObject(p0));
343+
public <ReturnT> ReturnT getObject(software.amazon.awssdk.services.s3.model.GetObjectRequest p0, software.amazon.awssdk.core.sync.ResponseTransformer<software.amazon.awssdk.services.s3.model.GetObjectResponse, ReturnT> p1) throws AwsServiceException, SdkClientException {
344+
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObject(p0, p1));
345345
}
346346

347347
@Override
@@ -380,13 +380,13 @@ public software.amazon.awssdk.services.s3.model.GetObjectTaggingResponse getObje
380380
}
381381

382382
@Override
383-
public software.amazon.awssdk.services.s3.model.GetObjectTorrentResponse getObjectTorrent(software.amazon.awssdk.services.s3.model.GetObjectTorrentRequest p0, java.nio.file.Path p1) throws AwsServiceException, SdkClientException {
384-
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObjectTorrent(p0, p1));
383+
public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectTorrentResponse> getObjectTorrent(software.amazon.awssdk.services.s3.model.GetObjectTorrentRequest p0) throws AwsServiceException, SdkClientException {
384+
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObjectTorrent(p0));
385385
}
386386

387387
@Override
388-
public software.amazon.awssdk.core.ResponseInputStream<software.amazon.awssdk.services.s3.model.GetObjectTorrentResponse> getObjectTorrent(software.amazon.awssdk.services.s3.model.GetObjectTorrentRequest p0) throws AwsServiceException, SdkClientException {
389-
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObjectTorrent(p0));
388+
public software.amazon.awssdk.services.s3.model.GetObjectTorrentResponse getObjectTorrent(software.amazon.awssdk.services.s3.model.GetObjectTorrentRequest p0, java.nio.file.Path p1) throws AwsServiceException, SdkClientException {
389+
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.getObjectTorrent(p0, p1));
390390
}
391391

392392
@Override
@@ -570,12 +570,12 @@ public software.amazon.awssdk.services.s3.model.PutBucketWebsiteResponse putBuck
570570
}
571571

572572
@Override
573-
public software.amazon.awssdk.services.s3.model.PutObjectResponse putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest p0, software.amazon.awssdk.core.sync.RequestBody p1) throws AwsServiceException, SdkClientException {
573+
public software.amazon.awssdk.services.s3.model.PutObjectResponse putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest p0, java.nio.file.Path p1) throws AwsServiceException, SdkClientException {
574574
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.putObject(p0, p1));
575575
}
576576

577577
@Override
578-
public software.amazon.awssdk.services.s3.model.PutObjectResponse putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest p0, java.nio.file.Path p1) throws AwsServiceException, SdkClientException {
578+
public software.amazon.awssdk.services.s3.model.PutObjectResponse putObject(software.amazon.awssdk.services.s3.model.PutObjectRequest p0, software.amazon.awssdk.core.sync.RequestBody p1) throws AwsServiceException, SdkClientException {
579579
return executeInBucketRegion(p0.bucket(), s3Client -> s3Client.putObject(p0, p1));
580580
}
581581

0 commit comments

Comments
 (0)