You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by me...@apache.org on 2013/01/15 09:55:22 UTC
svn commit: r1433316 -
/jackrabbit/oak/trunk/oak-mongomk/src/main/java/org/apache/jackrabbit/mongomk/impl/instruction/CommitCommandInstructionVisitor.java
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);
}
}