leaf-soba commented on code in PR #18868:
URL: https://github.com/apache/kafka/pull/18868#discussion_r1953667432


##########
clients/src/main/java/org/apache/kafka/clients/ClusterConnectionStates.java:
##########
@@ -457,7 +457,7 @@ public boolean isConnectionSetupTimeout(String id, long 
now) {
     public List<String> nodesWithConnectionSetupTimeout(long now) {
         return connectingNodes.stream()
             .filter(id -> isConnectionSetupTimeout(id, now))
-            .collect(Collectors.toList());
+            .toList();

Review Comment:
   > If I understand correctly, `Stream.toList()` was introduced in Java 16. 
The clients build at Java 11, while the broker builds at Java 17. As a result, 
I don't think you can use `Stream.toList()` in the clients project.
   
   > Yes. We couldn't invoke `toList()` in modules that still use Java 11. 
Please refer to the following:
   > 
   > 
https://github.com/apache/kafka/blob/c70b7c4b9e6fbd805d9a229b4ac13c1e10016d76/build.gradle#L52
   
   Thanks for the clarification! Apologies for not checking the Java version of 
the modules more carefully. I have reverted the affected modules still using 
Java 11 to .collect(Collectors.toList());.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to