jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1412889 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
Date Fri, 23 Nov 2012 13:42:55 GMT
Author: mduerig
Date: Fri Nov 23 13:42:54 2012
New Revision: 1412889

URL: http://svn.apache.org/viewvc?rev=1412889&view=rev
Log:
 OAK-471: Use NodeBuilder.setNode() in MergingNodeStateDiff.addChild() instead of explicit
tree traversal

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java?rev=1412889&r1=1412888&r2=1412889&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/MergingNodeStateDiff.java
Fri Nov 23 13:42:54 2012
@@ -21,7 +21,6 @@ import org.apache.jackrabbit.oak.api.Typ
 import org.apache.jackrabbit.oak.plugins.commit.ConflictHandlerWrapper;
 import org.apache.jackrabbit.oak.plugins.memory.MemoryPropertyBuilder;
 import org.apache.jackrabbit.oak.spi.commit.ConflictHandler;
-import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
@@ -204,19 +203,13 @@ class MergingNodeStateDiff implements No
     //-------------------------------------------------------------<private >---
 
     private static void addChild(NodeBuilder target, String name, NodeState state) {
-        NodeBuilder child = target.child(name);
-        for (PropertyState property : state.getProperties()) {
-            child.setProperty(property);
-        }
+        target.setNode(name, state);
         PropertyState childOrder = target.getProperty(TreeImpl.OAK_CHILD_ORDER);
         if (childOrder != null) {
             PropertyBuilder<String> builder = MemoryPropertyBuilder.copy(Type.STRING,
childOrder);
             builder.addValue(name);
             target.setProperty(builder.getPropertyState());
         }
-        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
-            addChild(child, entry.getName(), entry.getNodeState());
-        }
     }
 
     private static void removeChild(NodeBuilder target, String name) {



Mime
View raw message