jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r454735 - /jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
Date Tue, 10 Oct 2006 13:34:01 GMT
Author: stefan
Date: Tue Oct 10 06:33:55 2006
New Revision: 454735

URL: http://svn.apache.org/viewvc?view=rev&rev=454735
Log:
JCR-586: Removing a mixin that adds a same-name-sibling child node throws an ItemNotFoundException

Modified:
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java?view=diff&rev=454735&r1=454734&r2=454735
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/NodeImpl.java Tue
Oct 10 06:33:55 2006
@@ -1207,8 +1207,9 @@
         }
         // use temp array to avoid ConcurrentModificationException
         ArrayList list = new ArrayList(thisState.getChildNodeEntries());
-        for (Iterator iter = list.iterator(); iter.hasNext();) {
-            NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) iter.next();
+        // start from tail to avoid problems with same-name siblings
+        for (int i = list.size() - 1; i >= 0; i--) {
+            NodeState.ChildNodeEntry entry = (NodeState.ChildNodeEntry) list.get(i);
             NodeImpl node = (NodeImpl) itemMgr.getItem(entry.getId());
             // check if node has been defined by mixin type (or one of its supertypes)
             NodeTypeImpl declaringNT = (NodeTypeImpl) node.getDefinition().getDeclaringNodeType();



Mime
View raw message