Skip to content

Commit cb12a33

Browse files
committed
Fix Javadocs on async paginators
1 parent 34a71cd commit cb12a33

File tree

6 files changed

+25
-21
lines changed

6 files changed

+25
-21
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"category": "AWS SDK for Java v2",
3+
"type": "bugfix",
4+
"description": "Fix async pagination javadocs to use the correct method name `SdkPublisher#subscribe`."
5+
}

codegen/src/main/java/software/amazon/awssdk/codegen/docs/PaginationDocs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,13 @@ private String getAsyncCodeSnippets() {
163163

164164
return CodeBlock.builder()
165165
.add("\n\n<p>The following are few ways to use the response class:</p>")
166-
.add("1) Using the forEach helper method",
166+
.add("1) Using the subscribe helper method",
167167
TypeName.get(SequentialSubscriber.class))
168168
.add(buildCode(CodeBlock.builder()
169169
.add(callOperationOnClient)
170170
.add(CodeBlock.builder()
171171
.addStatement("CompletableFuture<Void> future = publisher"
172-
+ ".forEach(res -> "
172+
+ ".subscribe(res -> "
173173
+ "{ // Do something with the response })")
174174
.addStatement("future.get()")
175175
.build())

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -451,12 +451,12 @@ public CompletableFuture<PaginatedOperationWithResultKeyResponse> paginatedOpera
451451
* <p>
452452
* The following are few ways to use the response class:
453453
* </p>
454-
* 1) Using the forEach helper method
454+
* 1) Using the subscribe helper method
455455
*
456456
* <pre>
457457
* {@code
458458
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
459-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
459+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
460460
* future.get();
461461
* }
462462
* </pre>
@@ -567,12 +567,12 @@ public CompletableFuture<PaginatedOperationWithoutResultKeyResponse> paginatedOp
567567
* <p>
568568
* The following are few ways to use the response class:
569569
* </p>
570-
* 1) Using the forEach helper method
570+
* 1) Using the subscribe helper method
571571
*
572572
* <pre>
573573
* {@code
574574
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
575-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
575+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
576576
* future.get();
577577
* }
578578
* </pre>
@@ -824,4 +824,3 @@ private HttpResponseHandler<AwsServiceException> createErrorResponseHandler(Base
824824
return protocolFactory.createErrorResponseHandler(operationMetadata);
825825
}
826826
}
827-

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -490,12 +490,12 @@ default CompletableFuture<PaginatedOperationWithResultKeyResponse> paginatedOper
490490
* <p>
491491
* The following are few ways to use the response class:
492492
* </p>
493-
* 1) Using the forEach helper method
493+
* 1) Using the subscribe helper method
494494
*
495495
* <pre>
496496
* {@code
497497
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
498-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
498+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
499499
* future.get();
500500
* }
501501
* </pre>
@@ -561,12 +561,12 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey
561561
* <p>
562562
* The following are few ways to use the response class:
563563
* </p>
564-
* 1) Using the forEach helper method
564+
* 1) Using the subscribe helper method
565565
*
566566
* <pre>
567567
* {@code
568568
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
569-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
569+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
570570
* future.get();
571571
* }
572572
* </pre>
@@ -634,12 +634,12 @@ default PaginatedOperationWithResultKeyPublisher paginatedOperationWithResultKey
634634
* <p>
635635
* The following are few ways to use the response class:
636636
* </p>
637-
* 1) Using the forEach helper method
637+
* 1) Using the subscribe helper method
638638
*
639639
* <pre>
640640
* {@code
641641
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
642-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
642+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
643643
* future.get();
644644
* }
645645
* </pre>
@@ -771,12 +771,12 @@ default CompletableFuture<PaginatedOperationWithoutResultKeyResponse> paginatedO
771771
* <p>
772772
* The following are few ways to use the response class:
773773
* </p>
774-
* 1) Using the forEach helper method
774+
* 1) Using the subscribe helper method
775775
*
776776
* <pre>
777777
* {@code
778778
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
779-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
779+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
780780
* future.get();
781781
* }
782782
* </pre>
@@ -844,12 +844,12 @@ default PaginatedOperationWithoutResultKeyPublisher paginatedOperationWithoutRes
844844
* <p>
845845
* The following are few ways to use the response class:
846846
* </p>
847-
* 1) Using the forEach helper method
847+
* 1) Using the subscribe helper method
848848
*
849849
* <pre>
850850
* {@code
851851
* software.amazon.awssdk.services.json.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
852-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
852+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
853853
* future.get();
854854
* }
855855
* </pre>

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/paginators/PaginatedOperationWithResultKeyPublisher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@
3838
* <p>
3939
* The following are few ways to use the response class:
4040
* </p>
41-
* 1) Using the forEach helper method
41+
* 1) Using the subscribe helper method
4242
*
4343
* <pre>
4444
* {@code
4545
* software.amazon.awssdk.services.jsonprotocoltests.paginators.PaginatedOperationWithResultKeyPublisher publisher = client.paginatedOperationWithResultKeyPaginator(request);
46-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
46+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
4747
* future.get();
4848
* }
4949
* </pre>

codegen/src/test/resources/software/amazon/awssdk/codegen/poet/paginators/PaginatedOperationWithoutResultKeyPublisher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@
3333
* <p>
3434
* The following are few ways to use the response class:
3535
* </p>
36-
* 1) Using the forEach helper method
36+
* 1) Using the subscribe helper method
3737
*
3838
* <pre>
3939
* {@code
4040
* software.amazon.awssdk.services.jsonprotocoltests.paginators.PaginatedOperationWithoutResultKeyPublisher publisher = client.paginatedOperationWithoutResultKeyPaginator(request);
41-
* CompletableFuture<Void> future = publisher.forEach(res -> { // Do something with the response });
41+
* CompletableFuture<Void> future = publisher.subscribe(res -> { // Do something with the response });
4242
* future.get();
4343
* }
4444
* </pre>

0 commit comments

Comments
 (0)