Concurrent Modification Exception -- weird fix
807591Apr 2 2008 — edited Apr 3 2008while(childItr.hasNext()){
Peer child = childItr.next();
child.myClientSession.myPeers.add(contactMsg.source);
}
The code above gave me a Concurrent Modification Exception at line >>Peer child = childItr.next();
Then, I simply added the below line in between the two lines in the while
child = child;
The bug is fixed.. But it intrigues me..
What would have happened given that myPeers is a HashSet and this code runs within a method of the same 'Peer' class
thanks
vinoth