jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1492100 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/core/RootImpl.java test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Date Wed, 12 Jun 2013 07:57:41 GMT
Author: mduerig
Date: Wed Jun 12 07:57:41 2013
New Revision: 1492100

URL: http://svn.apache.org/r1492100
Log:
OAK-864: MicroKernelException when moving a node to its own descendant
fix for Root.move

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.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=1492100&r1=1492099&r2=1492100&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
Wed Jun 12 07:57:41 2013
@@ -180,6 +180,10 @@ public class RootImpl implements Root {
     
     @Override
     public boolean move(String sourcePath, String destPath) {
+        if (PathUtils.isAncestor(sourcePath, destPath)) {
+            return false;
+        }
+
         checkLive();
         TreeImpl destParent = rootTree.getTree(getParentPath(destPath));
         if (!destParent.exists()) {

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java?rev=1492100&r1=1492099&r2=1492100&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/core/RootImplTest.java
Wed Jun 12 07:57:41 2013
@@ -36,7 +36,6 @@ import org.apache.jackrabbit.oak.api.Tre
 import org.apache.jackrabbit.oak.api.Type;
 import org.junit.After;
 import org.junit.Before;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class RootImplTest extends OakBaseTest {
@@ -176,7 +175,6 @@ public class RootImplTest extends OakBas
     }
 
     @Test
-    @Ignore
     public void moveToDescendant() throws CommitFailedException {
         Root root = session.getLatestRoot();
         root.getTree("/").addChild("s");



Mime
View raw message