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 md...@apache.org on 2013/04/09 11:59:11 UTC
svn commit: r1465954 -
/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
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;
}