jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1465954 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Date Tue, 09 Apr 2013 09:59:11 GMT
Author: mduerig
Date: Tue Apr  9 09:59:11 2013
New Revision: 1465954

URL: http://svn.apache.org/r1465954
Log:
OAK-709: Consider moving permission evaluation to the node state level
Simplify move

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

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1465954&r1=1465953&r2=1465954&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Tue Apr  9 09:59:11 2013
@@ -186,30 +186,18 @@ public class RootImpl implements Root {
     @Override
     public boolean move(String sourcePath, String destPath) {
         checkLive();
-        TreeImpl source = rootTree.getTree(sourcePath);
-        if (source == null) {
-            return false;
-        }
         TreeImpl destParent = rootTree.getTree(getParentPath(destPath));
         if (destParent == null) {
             return false;
         }
-
-        String destName = getName(destPath);
-        if (destParent.hasChild(destName)) {
-            return false;
-        }
-
         purgePendingChanges();
-        source.moveTo(destParent, destName);
         boolean success = branch.move(sourcePath, destPath);
         reset();
         if (success) {
             getTree(getParentPath(sourcePath)).updateChildOrder();
             getTree(getParentPath(destPath)).updateChildOrder();
+            lastMove = lastMove.setMove(sourcePath, destParent, getName(destPath));
         }
-
-        lastMove = lastMove.setMove(sourcePath, destParent, destName);
         return success;
     }
 



Mime
View raw message