jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1455172 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Date Mon, 11 Mar 2013 15:14:38 GMT
Author: mduerig
Date: Mon Mar 11 15:14:38 2013
New Revision: 1455172

URL: http://svn.apache.org/r1455172
Log:
OAK-691: Error while moving a node if the destination is not connected

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?rev=1455172&r1=1455171&r2=1455172&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Mon Mar 11 15:14:38 2013
@@ -440,19 +440,20 @@ public class TreeImpl implements Tree {
     /**
      * Move this tree to the parent at {@code destParent} with the new name
      * {@code destName}.
-     *
      * @param destParent new parent for this tree
      * @param destName   new name for this tree
      */
     void moveTo(TreeImpl destParent, String destName) {
         name = destName;
         parent = destParent;
-        if (parent.nodeBuilder.hasChildNode(name)) {
-            nodeBuilder = parent.nodeBuilder.child(name);
-        } else {
-            // make this builder disconnected from its new parent
-            nodeBuilder = parent.nodeBuilder.child(name);
-            parent.nodeBuilder.removeNode(name);
+        if (!parent.isDisconnected()) {
+            if (parent.nodeBuilder.hasChildNode(name)) {
+                nodeBuilder = parent.nodeBuilder.child(name);
+            } else {
+                // make this builder disconnected from its new parent
+                nodeBuilder = parent.nodeBuilder.child(name);
+                parent.nodeBuilder.removeNode(name);
+            }
         }
     }
 



Mime
View raw message