jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Weston Bustraan (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-2807) ConcurrentModificationException in SessionItemStateManager.getIdOfRootTransientNodeState()
Date Sat, 06 Nov 2010 14:41:42 GMT

    [ https://issues.apache.org/jira/browse/JCR-2807?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12928981#action_12928981
] 

Weston Bustraan commented on JCR-2807:
--------------------------------------

Ok, I can fix the root node permissions.

In JCR 2.0, Node.save() is deprecated.

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


Mime
View raw message