belliottsmith commented on code in PR #65:
URL: https://github.com/apache/cassandra-accord/pull/65#discussion_r1442865404


##########
accord-core/src/main/java/accord/local/Node.java:
##########
@@ -479,9 +486,19 @@ public <T> void send(Collection<Id> to, Function<Id, 
Request> requestFactory, Ca
     public <T> void send(Collection<Id> to, Function<Id, Request> 
requestFactory, AgentExecutor executor, Callback<T> callback)
     {
         checkStore(executor);
+        checkIterationSafe(to);
         to.forEach(dst -> messageSink.send(dst, requestFactory.apply(dst), 
executor, callback));
     }
 
+    private static void checkIterationSafe(Collection<?> collection)
+    {
+        if (!Invariants.isParanoid())
+            return;
+        if (collection instanceof List) return;
+        if (collection instanceof NavigableSet || collection instanceof 
LinkedHashSet || 
"java.util.LinkedHashMap.LinkedKeySet".equals(collection.getClass().getCanonicalName()))
 return;

Review Comment:
   `|| collection instanceof DeterministicSet`



-- 
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