pkuwm commented on a change in pull request #785: Fix the 
ConcurrentModificationException in ClusterEvent.java
URL: https://github.com/apache/helix/pull/785#discussion_r382379284
 
 

 ##########
 File path: 
helix-core/src/main/java/org/apache/helix/controller/stages/ClusterEvent.java
 ##########
 @@ -114,11 +127,6 @@ public String toString() {
   }
 
   public ClusterEvent clone(String eventId) {
-    ClusterEvent newEvent = new ClusterEvent(_clusterName, _eventType, 
eventId);
-    newEvent.setCreationTime(_creationTime);
-    for (String attributeName : _eventAttributeMap.keySet()) {
 
 Review comment:
   Can you explain why the copy constructor is different from the original 
for-loop? Maybe I miss something, but I see that `new HashMap<>(map)` is 
basically also a for-loop to copy the original map entries, which means, the 
entries could still change and throws concurrent mod exception for the step 
`new HashMap<>(map)`.
   Please correct me if I am wrong. Appreciate it!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to