jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1151414 - /jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Date Wed, 27 Jul 2011 10:06:05 GMT
Author: thomasm
Date: Wed Jul 27 10:06:05 2011
New Revision: 1151414

URL: http://svn.apache.org/viewvc?rev=1151414&view=rev
Log:
Add nodes recursively, but not in reverse order

Modified:
    jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java

Modified: jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java?rev=1151414&r1=1151413&r2=1151414&view=diff
==============================================================================
--- jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
(original)
+++ jackrabbit/sandbox/microkernel/src/main/java/org/apache/jackrabbit/mk/MicroKernelImpl.java
Wed Jul 27 10:06:05 2011
@@ -31,7 +31,6 @@ import org.apache.jackrabbit.mk.util.Pat
 import java.io.InputStream;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
@@ -256,9 +255,7 @@ public class MicroKernelImpl implements 
                     // build the list of added nodes recursively
                     LinkedList<AddNodeOperation> list = new LinkedList<AddNodeOperation>();
                     addNode(list, parentPath, nodeName, t);
-                    // add the nodes in reverse order
-                    for (Iterator<AddNodeOperation> it = list.descendingIterator();
it.hasNext(); ) {
-                        AddNodeOperation op = it.next();
+                    for (AddNodeOperation op : list) {
                         cb.addNode(op.path, op.name, op.props);
                     }
                     break;
@@ -426,6 +423,7 @@ public class MicroKernelImpl implements 
         AddNodeOperation op = new AddNodeOperation();
         op.path = path;
         op.name = name;
+        list.add(op);
         if (!t.matches('}')) {
             do {
                 String key = t.readString();
@@ -438,7 +436,6 @@ public class MicroKernelImpl implements 
             } while (t.matches(','));
             t.read('}');
         }
-        list.add(op);
     }
 
     //--------------------------------------------------------< inner classes >



Mime
View raw message