Skip to content

Commit 227c639

Browse files
authored
Remove unused var (#2858)
1 parent 64a0a67 commit 227c639

File tree

9 files changed

+23
-111
lines changed

9 files changed

+23
-111
lines changed

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/JsonProtocolSpec.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import java.util.Optional;
2929
import java.util.concurrent.CompletableFuture;
3030
import javax.lang.model.element.Modifier;
31-
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
3231
import software.amazon.awssdk.awscore.eventstream.EventStreamAsyncResponseTransformer;
3332
import software.amazon.awssdk.awscore.eventstream.EventStreamTaggedUnionPojoSupplier;
3433
import software.amazon.awssdk.awscore.eventstream.RestEventStreamAsyncResponseTransformer;
@@ -250,8 +249,6 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper
250249
String whenComplete = whenCompleteBody(opModel, customerResponseHandler);
251250
if (!whenComplete.isEmpty()) {
252251
String whenCompletedFutureName = "whenCompleted";
253-
builder.addStatement("$T requestOverrideConfig = $L.overrideConfiguration().orElse(null)",
254-
AwsRequestOverrideConfiguration.class, opModel.getInput().getVariableName());
255252
builder.addStatement("$T<$T> $N = $N$L", CompletableFuture.class, executeFutureValueType,
256253
whenCompletedFutureName, "executeFuture", whenComplete);
257254
builder.addStatement("executeFuture = $T.forwardExceptionTo($N, executeFuture)",

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/QueryProtocolSpec.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Optional;
2525
import java.util.concurrent.CompletableFuture;
2626
import javax.lang.model.element.Modifier;
27-
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
2827
import software.amazon.awssdk.awscore.exception.AwsServiceException;
2928
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
3029
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
@@ -148,9 +147,6 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper
148147
opModel.getInput().getVariableName(),
149148
opModel.hasStreamingOutput() ? ", asyncResponseTransformer" : "");
150149

151-
builder.addStatement("$T requestOverrideConfig = $L.overrideConfiguration().orElse(null)",
152-
AwsRequestOverrideConfiguration.class, opModel.getInput().getVariableName());
153-
154150
String whenCompleteFutureName = "whenCompleteFuture";
155151
builder.addStatement("$T $N = null", ParameterizedTypeName.get(ClassName.get(CompletableFuture.class),
156152
executeFutureValueType), whenCompleteFutureName);

codegen/src/main/java/software/amazon/awssdk/codegen/poet/client/specs/XmlProtocolSpec.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Map;
2525
import java.util.Optional;
2626
import java.util.concurrent.CompletableFuture;
27-
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
2827
import software.amazon.awssdk.codegen.model.config.customization.S3ArnableFieldConfig;
2928
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
3029
import software.amazon.awssdk.codegen.model.intermediate.OperationModel;
@@ -178,9 +177,6 @@ public CodeBlock asyncExecutionHandler(IntermediateModel intermediateModel, Oper
178177
s3ArnableFields(opModel, model).ifPresent(builder::add);
179178
builder.add(".withInput($L) $L);", opModel.getInput().getVariableName(), opModel.hasStreamingOutput() ?
180179
", asyncResponseTransformer" : "");
181-
builder.addStatement("$T requestOverrideConfig = $L.overrideConfiguration().orElse(null)",
182-
AwsRequestOverrideConfiguration.class, opModel.getInput().getVariableName());
183-
184180
String whenCompleteFutureName = "whenCompleteFuture";
185181
builder.addStatement("$T $N = null", ParameterizedTypeName.get(ClassName.get(CompletableFuture.class),
186182
executeFutureValueType), whenCompleteFutureName);

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/client/test-async-client-class.java

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@ public CompletableFuture<APostOperationResponse> aPostOperation(APostOperationRe
189189
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
190190
.withMetricCollector(apiCallMetricCollector).hostPrefixExpression(resolvedHostExpression)
191191
.withInput(aPostOperationRequest));
192-
AwsRequestOverrideConfiguration requestOverrideConfig = aPostOperationRequest.overrideConfiguration().orElse(null);
193192
CompletableFuture<APostOperationResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
194193
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
195194
});
@@ -249,8 +248,6 @@ public CompletableFuture<APostOperationWithOutputResponse> aPostOperationWithOut
249248
.withMarshaller(new APostOperationWithOutputRequestMarshaller(protocolFactory))
250249
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
251250
.withMetricCollector(apiCallMetricCollector).withInput(aPostOperationWithOutputRequest));
252-
AwsRequestOverrideConfiguration requestOverrideConfig = aPostOperationWithOutputRequest.overrideConfiguration()
253-
.orElse(null);
254251
CompletableFuture<APostOperationWithOutputResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
255252
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
256253
});
@@ -335,8 +332,6 @@ public CompletableFuture<Void> eventStreamOperation(EventStreamOperationRequest
335332
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
336333
.withMetricCollector(apiCallMetricCollector).withInput(eventStreamOperationRequest),
337334
restAsyncResponseTransformer);
338-
AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationRequest.overrideConfiguration().orElse(
339-
null);
340335
CompletableFuture<Void> whenCompleted = executeFuture.whenComplete((r, e) -> {
341336
if (e != null) {
342337
try {
@@ -412,8 +407,6 @@ public CompletableFuture<EventStreamOperationWithOnlyInputResponse> eventStreamO
412407
.withAsyncRequestBody(AsyncRequestBody.fromPublisher(adapted)).withResponseHandler(responseHandler)
413408
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
414409
.withInput(eventStreamOperationWithOnlyInputRequest));
415-
AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationWithOnlyInputRequest
416-
.overrideConfiguration().orElse(null);
417410
CompletableFuture<EventStreamOperationWithOnlyInputResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
418411
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
419412
});
@@ -494,8 +487,6 @@ public CompletableFuture<Void> eventStreamOperationWithOnlyOutput(
494487
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
495488
.withMetricCollector(apiCallMetricCollector)
496489
.withInput(eventStreamOperationWithOnlyOutputRequest), restAsyncResponseTransformer);
497-
AwsRequestOverrideConfiguration requestOverrideConfig = eventStreamOperationWithOnlyOutputRequest
498-
.overrideConfiguration().orElse(null);
499490
CompletableFuture<Void> whenCompleted = executeFuture.whenComplete((r, e) -> {
500491
if (e != null) {
501492
try {
@@ -564,8 +555,6 @@ public CompletableFuture<GetWithoutRequiredMembersResponse> getWithoutRequiredMe
564555
.withMarshaller(new GetWithoutRequiredMembersRequestMarshaller(protocolFactory))
565556
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
566557
.withMetricCollector(apiCallMetricCollector).withInput(getWithoutRequiredMembersRequest));
567-
AwsRequestOverrideConfiguration requestOverrideConfig = getWithoutRequiredMembersRequest.overrideConfiguration()
568-
.orElse(null);
569558
CompletableFuture<GetWithoutRequiredMembersResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
570559
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
571560
});
@@ -625,8 +614,6 @@ public CompletableFuture<OperationWithChecksumRequiredResponse> operationWithChe
625614
.withMetricCollector(apiCallMetricCollector)
626615
.putExecutionAttribute(SdkInternalExecutionAttribute.HTTP_CHECKSUM_REQUIRED,
627616
HttpChecksumRequired.create()).withInput(operationWithChecksumRequiredRequest));
628-
AwsRequestOverrideConfiguration requestOverrideConfig = operationWithChecksumRequiredRequest.overrideConfiguration()
629-
.orElse(null);
630617
CompletableFuture<OperationWithChecksumRequiredResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
631618
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
632619
});
@@ -683,8 +670,6 @@ public CompletableFuture<PaginatedOperationWithResultKeyResponse> paginatedOpera
683670
.withMarshaller(new PaginatedOperationWithResultKeyRequestMarshaller(protocolFactory))
684671
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
685672
.withMetricCollector(apiCallMetricCollector).withInput(paginatedOperationWithResultKeyRequest));
686-
AwsRequestOverrideConfiguration requestOverrideConfig = paginatedOperationWithResultKeyRequest
687-
.overrideConfiguration().orElse(null);
688673
CompletableFuture<PaginatedOperationWithResultKeyResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
689674
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
690675
});
@@ -718,7 +703,7 @@ public CompletableFuture<PaginatedOperationWithResultKeyResponse> paginatedOpera
718703
* The following are few ways to use the response class:
719704
* </p>
720705
* 1) Using the subscribe helper method
721-
*
706+
*
722707
* <pre>
723708
* {@code
724709
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
@@ -728,19 +713,19 @@ public CompletableFuture<PaginatedOperationWithResultKeyResponse> paginatedOpera
728713
* </pre>
729714
*
730715
* 2) Using a custom subscriber
731-
*
716+
*
732717
* <pre>
733718
* {@code
734719
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
735720
* publisher.subscribe(new Subscriber<software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse>() {
736-
*
721+
*
737722
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
738-
*
739-
*
723+
*
724+
*
740725
* public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithResultKeyResponse response) { //... };
741726
* });}
742727
* </pre>
743-
*
728+
*
744729
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
745730
* <p>
746731
* <b>Please notice that the configuration of MaxResults won't limit the number of results you get with the
@@ -818,8 +803,6 @@ public CompletableFuture<PaginatedOperationWithoutResultKeyResponse> paginatedOp
818803
.withMarshaller(new PaginatedOperationWithoutResultKeyRequestMarshaller(protocolFactory))
819804
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
820805
.withMetricCollector(apiCallMetricCollector).withInput(paginatedOperationWithoutResultKeyRequest));
821-
AwsRequestOverrideConfiguration requestOverrideConfig = paginatedOperationWithoutResultKeyRequest
822-
.overrideConfiguration().orElse(null);
823806
CompletableFuture<PaginatedOperationWithoutResultKeyResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
824807
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
825808
});
@@ -853,7 +836,7 @@ public CompletableFuture<PaginatedOperationWithoutResultKeyResponse> paginatedOp
853836
* The following are few ways to use the response class:
854837
* </p>
855838
* 1) Using the subscribe helper method
856-
*
839+
*
857840
* <pre>
858841
* {@code
859842
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
@@ -863,19 +846,19 @@ public CompletableFuture<PaginatedOperationWithoutResultKeyResponse> paginatedOp
863846
* </pre>
864847
*
865848
* 2) Using a custom subscriber
866-
*
849+
*
867850
* <pre>
868851
* {@code
869852
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
870853
* publisher.subscribe(new Subscriber<software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyResponse>() {
871-
*
854+
*
872855
* public void onSubscribe(org.reactivestreams.Subscriber subscription) { //... };
873-
*
874-
*
856+
*
857+
*
875858
* public void onNext(software.amazon.awssdk.services.json.model.PaginatedOperationWithoutResultKeyResponse response) { //... };
876859
* });}
877860
* </pre>
878-
*
861+
*
879862
* As the response is a publisher, it can work well with third party reactive streams implementations like RxJava2.
880863
* <p>
881864
* <b>Please notice that the configuration of MaxResults won't limit the number of results you get with the
@@ -964,8 +947,6 @@ public CompletableFuture<StreamingInputOperationResponse> streamingInputOperatio
964947
.asyncRequestBody(requestBody).build()).withResponseHandler(responseHandler)
965948
.withErrorResponseHandler(errorResponseHandler).withMetricCollector(apiCallMetricCollector)
966949
.withAsyncRequestBody(requestBody).withInput(streamingInputOperationRequest));
967-
AwsRequestOverrideConfiguration requestOverrideConfig = streamingInputOperationRequest.overrideConfiguration()
968-
.orElse(null);
969950
CompletableFuture<StreamingInputOperationResponse> whenCompleted = executeFuture.whenComplete((r, e) -> {
970951
metricPublishers.forEach(p -> p.publish(apiCallMetricCollector.collect()));
971952
});
@@ -1040,8 +1021,6 @@ public <ReturnT> CompletableFuture<ReturnT> streamingInputOutputOperation(
10401021
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
10411022
.withMetricCollector(apiCallMetricCollector).withAsyncRequestBody(requestBody)
10421023
.withInput(streamingInputOutputOperationRequest), asyncResponseTransformer);
1043-
AwsRequestOverrideConfiguration requestOverrideConfig = streamingInputOutputOperationRequest.overrideConfiguration()
1044-
.orElse(null);
10451024
CompletableFuture<ReturnT> whenCompleted = executeFuture.whenComplete((r, e) -> {
10461025
if (e != null) {
10471026
runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring",
@@ -1110,8 +1089,6 @@ public <ReturnT> CompletableFuture<ReturnT> streamingOutputOperation(
11101089
.withResponseHandler(responseHandler).withErrorResponseHandler(errorResponseHandler)
11111090
.withMetricCollector(apiCallMetricCollector).withInput(streamingOutputOperationRequest),
11121091
asyncResponseTransformer);
1113-
AwsRequestOverrideConfiguration requestOverrideConfig = streamingOutputOperationRequest.overrideConfiguration()
1114-
.orElse(null);
11151092
CompletableFuture<ReturnT> whenCompleted = executeFuture.whenComplete((r, e) -> {
11161093
if (e != null) {
11171094
runAndLogError(log, "Exception thrown in exceptionOccurred callback, ignoring",
@@ -1194,4 +1171,3 @@ private HttpResponseHandler<AwsServiceException> createErrorResponseHandler(Base
11941171
return protocolFactory.createErrorResponseHandler(operationMetadata);
11951172
}
11961173
}
1197-

0 commit comments

Comments
 (0)