You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Stefan Guggisberg (JIRA)" <ji...@apache.org> on 2010/11/06 14:47:44 UTC

[jira] Assigned: (JCR-2807) ConcurrentModificationException in SessionItemStateManager.getIdOfRootTransientNodeState()

     [ https://issues.apache.org/jira/browse/JCR-2807?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Guggisberg reassigned JCR-2807:
--------------------------------------

    Assignee: Stefan Guggisberg

> ConcurrentModificationException in SessionItemStateManager.getIdOfRootTransientNodeState()
> ------------------------------------------------------------------------------------------
>
>                 Key: JCR-2807
>                 URL: https://issues.apache.org/jira/browse/JCR-2807
>             Project: Jackrabbit Content Repository
>          Issue Type: Bug
>    Affects Versions: 2.1.2
>            Reporter: Weston Bustraan
>            Assignee: Stefan Guggisberg
>
> SessionItemStateManager.getIdOfRootTransientNodeState() is throwing a ConcurrentModificationException on line 607:
> Here's a snippet of the code:
> {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);
>                         }
>                     }
> {code}
> Can't use Collection.remove(Object) in the middle of iterating. It should probably be changed to use Iterator.remove():
> {code}
>                     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();
>                         }
>                     }
> {code}
> Any idea what I could do differently to workaround the issue?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.