Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.1.2
-
None
-
None
Description
SessionItemStateManager.getIdOfRootTransientNodeState() is throwing a ConcurrentModificationException on line 607:
Here's a snippet of the code:
for (NodeId id : candidateIds) { if (nodeId.equals(id) || hierMgr.isAncestor(id, nodeId)) { // already a candidate or a descendant thereof // => skip skip = true; break; } if (hierMgr.isAncestor(nodeId, id)) { // candidate is a descendant => remove candidateIds.remove(id); } }
Can't use Collection.remove(Object) in the middle of iterating. It should probably be changed to use Iterator.remove():
Iterator<NodeId> nodeIdItor = candidateIds.iterator(); while (nodeIdItor.hasNext()) { NodeId id = nodeIdItor.next(); if (nodeId.equals(id) || hierMgr.isAncestor(id, nodeId)) { // already a candidate or a descendant thereof // => skip skip = true; break; } if (hierMgr.isAncestor(nodeId, id)) { // candidate is a descendant => remove nodeIdItor.remove(); } }
Any idea what I could do differently to workaround the issue?