jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r159401 - incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java
Date Tue, 29 Mar 2005 17:13:44 GMT
Author: stefan
Date: Tue Mar 29 09:13:43 2005
New Revision: 159401

URL: http://svn.apache.org/viewcvs?view=rev&rev=159401
Log:
fixed bug in NodeState.getAdded/RemovedChildNodeEntries(): 
returned entries potentially had incorrect index 

Modified:
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java?view=diff&r1=159400&r2=159401
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/NodeState.java Tue
Mar 29 09:13:43 2005
@@ -875,15 +875,21 @@
                 return Collections.unmodifiableList(entries);
             }
 
-            ChildNodeEntries result = new ChildNodeEntries();
-            result.addAll(entries);
+            List result = new ArrayList(entries);
 
-            Iterator iter = other.entries.iterator();
-            while (iter.hasNext()) {
-                ChildNodeEntry entry = (ChildNodeEntry) iter.next();
-                result.remove(entry.getName(), entry.getUUID());
+            Iterator otherIter = other.entries.iterator();
+            while (otherIter.hasNext()) {
+                ChildNodeEntry otherEntry = (ChildNodeEntry) otherIter.next();
+                Iterator ourIter = entries.iterator();
+                while (ourIter.hasNext()) {
+                    ChildNodeEntry ourEntry = (ChildNodeEntry) ourIter.next();
+                    if (ourEntry.getName().equals(otherEntry.getName())
+                            && ourEntry.getUUID().equals(otherEntry.getUUID())) {
+                        result.remove(ourEntry);
+                    }
+                }
             }
-            return result.entries;
+            return result;
         }
     }
 



Mime
View raw message