This is an automated email from the ASF dual-hosted git repository.
He-Pin pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/pekko-http.git
The following commit(s) were added to refs/heads/main by this push:
new 61d29bb9b refactor: replace .collect(Collectors.toList()) with
.toList() (#1090)
61d29bb9b is described below
commit 61d29bb9b501e1c81f5de2103d7f7d6504280402
Author: He-Pin(kerr) <[email protected]>
AuthorDate: Fri Jun 26 17:15:37 2026 +0800
refactor: replace .collect(Collectors.toList()) with .toList() (#1090)
Motivation:
Java 16+ Stream.toList() provides a concise way to collect stream
elements into an unmodifiable list.
Modification:
Replace .collect(Collectors.toList()) with .toList() in
HttpClientDecodingExampleTest. Remove unused Collectors import.
Result:
Cleaner stream collection code using Java 17 API.
Tests:
Not run - compile-only test file changes
References:
None - Java 17 API modernization
---
.../src/test/java/docs/http/javadsl/HttpClientDecodingExampleTest.java | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git
a/docs/src/test/java/docs/http/javadsl/HttpClientDecodingExampleTest.java
b/docs/src/test/java/docs/http/javadsl/HttpClientDecodingExampleTest.java
index b44db2bf8..01491b247 100644
--- a/docs/src/test/java/docs/http/javadsl/HttpClientDecodingExampleTest.java
+++ b/docs/src/test/java/docs/http/javadsl/HttpClientDecodingExampleTest.java
@@ -19,7 +19,6 @@ import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import java.util.function.Function;
-import java.util.stream.Collectors;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.http.javadsl.Http;
import org.apache.pekko.http.javadsl.coding.Coder;
@@ -63,7 +62,7 @@ public class HttpClientDecodingExampleTest {
httpRequests.stream()
.map(req -> http.singleRequest(req).thenApply(decodeResponse))
.map(CompletionStage::toCompletableFuture)
- .collect(Collectors.toList());
+ .toList();
for (CompletableFuture<HttpResponse> futureResponse : futureResponses) {
final HttpResponse httpResponse = futureResponse.get();
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]