jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1421873 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
Date Fri, 14 Dec 2012 14:08:35 GMT
Author: mduerig
Date: Fri Dec 14 14:08:34 2012
New Revision: 1421873

URL: http://svn.apache.org/viewvc?rev=1421873&view=rev
Log:
simplify: use NodeBuilder.setNode for setting child node instead of explicit deep copy

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java?rev=1421873&r1=1421872&r2=1421873&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/commit/AnnotatingConflictHandler.java
Fri Dec 14 14:08:34 2012
@@ -18,14 +18,12 @@ package org.apache.jackrabbit.oak.plugin
 
 import java.util.List;
 
+import com.google.common.collect.Lists;
 import org.apache.jackrabbit.oak.api.PropertyState;
 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 com.google.common.collect.Lists;
-
 import static org.apache.jackrabbit.JcrConstants.JCR_MIXINTYPES;
 import static org.apache.jackrabbit.oak.api.Type.NAMES;
 import static org.apache.jackrabbit.oak.plugins.nodetype.NodeTypeConstants.ADD_EXISTING;
@@ -93,14 +91,14 @@ public class AnnotatingConflictHandler i
     @Override
     public Resolution addExistingNode(NodeBuilder parent, String name, NodeState ours, NodeState
theirs) {
         NodeBuilder marker = addConflictMarker(parent);
-        addChild(marker.child(ADD_EXISTING), name, ours);
+        marker.child(ADD_EXISTING).setNode(name, ours);
         return Resolution.THEIRS;
     }
 
     @Override
     public Resolution changeDeletedNode(NodeBuilder parent, String name, NodeState ours)
{
         NodeBuilder marker = addConflictMarker(parent);
-        addChild(marker.child(CHANGE_DELETED), name, ours);
+        marker.child(CHANGE_DELETED).setNode(name, ours);
         return Resolution.THEIRS;
     }
 
@@ -135,16 +133,6 @@ public class AnnotatingConflictHandler i
         return parent.child(REP_OURS);
     }
 
-    private static void addChild(NodeBuilder parent, String name, NodeState state) {
-        NodeBuilder child = parent.child(name);
-        for (PropertyState property : state.getProperties()) {
-            child.setProperty(property);
-        }
-        for (ChildNodeEntry entry : state.getChildNodeEntries()) {
-            addChild(child, entry.getName(), entry.getNodeState());
-        }
-    }
-
     private static void markChild(NodeBuilder parent, String name) {
         parent.child(name);
     }



Mime
View raw message