absurdfarce commented on code in PR #1945:
URL: 
https://github.com/apache/cassandra-java-driver/pull/1945#discussion_r1742395519


##########
core/src/main/java/com/datastax/oss/driver/internal/core/util/concurrent/CompletableFutures.java:
##########
@@ -100,7 +100,10 @@ public static <T> CompletionStage<Void> 
allSuccessful(List<CompletionStage<T>> i
                 } else {
                   Throwable finalError = errors.get(0);
                   for (int i = 1; i < errors.size(); i++) {
-                    finalError.addSuppressed(errors.get(i));
+                    Throwable suppressedError = errors.get(i);
+                    if (finalError != suppressedError) {
+                      finalError.addSuppressed(suppressedError);
+                    }

Review Comment:
   Took me a minute to convince myself that != is correct over equals() here.  
I couldn't find any docs on whether self-suppression was tied to reference 
equality or object equality but the more reference equality does seem like the 
more conservative approach here.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to