jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From meteata...@apache.org
Subject svn commit: r1433316 - /jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
Date Tue, 15 Jan 2013 08:55:22 GMT
Author: meteatamel
Date: Tue Jan 15 08:55:21 2013
New Revision: 1433316

URL: http://svn.apache.org/viewvc?rev=1433316&view=rev
Log:
Revert back the previous change

Modified:
    jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java

Modified: jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java?rev=1433316&r1=1433315&r2=1433316&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
(original)
+++ jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
Tue Jan 15 08:55:21 2013
@@ -145,7 +145,7 @@ public class CommitCommandInstructionVis
         String destParentPath = PathUtils.getParentPath(destPath);
         String destNodeName = PathUtils.getName(destPath);
 
-        MongoNode srcParent = getStoredNode(srcParentPath);
+        MongoNode srcParent = getStoredNode(srcParentPath, false);
         if (!srcParent.childExists(srcNodeName)) {
             throw new NotFoundException(srcPath);
         }
@@ -154,7 +154,7 @@ public class CommitCommandInstructionVis
             throw new RuntimeException("Node already exists at copy destination path: " +
destPath);
         }
 
-        copy(getStoredNode(srcPath), destPath);
+        copy(getStoredNode(srcPath, false), destPath);
 
         // Finally, add to destParent.
         destParent.addChild(destNodeName);
@@ -194,6 +194,10 @@ public class CommitCommandInstructionVis
     }
 
     private MongoNode getStoredNode(String path) {
+        return getStoredNode(path, true);
+    }
+
+    private MongoNode getStoredNode(String path, boolean addToMap) {
         MongoNode node = pathNodeMap.get(path);
         if (node != null) {
             return node;
@@ -213,8 +217,9 @@ public class CommitCommandInstructionVis
         }
         node = existCommand.getNode();
         node.removeField("_id");
-        pathNodeMap.put(path, node);
-
+        if (addToMap) {
+            pathNodeMap.put(path, node);
+        }
         return node;
     }
 
@@ -252,7 +257,7 @@ public class CommitCommandInstructionVis
         for (String child : children) {
             String srcChildPath = PathUtils.concat(srcNode.getPath(), child);
             String destChildPath = PathUtils.concat(destPath, child);
-            copy(getStoredNode(srcChildPath), destChildPath);
+            copy(getStoredNode(srcChildPath, false), destChildPath);
         }
     }
 



Mime
View raw message