Index: oak-jcr/pom.xml IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/pom.xml (date 1362603615000) +++ oak-jcr/pom.xml (date 1362559036000) @@ -223,7 +223,6 @@ org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryFromNode org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistory org.apache.jackrabbit.oak.jcr.version.VersionHistoryTest#testGetVersionHistoryAfterMove - org.apache.jackrabbit.oak.jcr.MoveTest Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemDelegate.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemDelegate.java (date 1362603615000) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/ItemDelegate.java (date 1362559036000) @@ -134,15 +134,17 @@ * The underlying {@link org.apache.jackrabbit.oak.api.TreeLocation} of this item. * The location is only re-resolved when the revision of this item does not match * the revision of the session or when the location does not exist (anymore). - * @return tree location of the underlying item. + * @return tree location of the underlying item. */ @Nonnull private synchronized TreeLocation getLocationInternal() { if (sessionDelegate.getRevision() != revision || !location.exists()) { - location = sessionDelegate.getLocation(location.getPath()); + location = sessionDelegate.getLocation(getPath(location)); revision = sessionDelegate.getRevision(); } return location; } + + protected abstract String getPath(TreeLocation location); } Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java (date 1362603615000) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java (date 1362559036000) @@ -34,6 +34,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.TreeLocation; import org.apache.jackrabbit.oak.commons.PathUtils; +import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager; import org.apache.jackrabbit.oak.plugins.memory.PropertyStates; /** @@ -254,6 +255,18 @@ throw new InvalidItemStateException(); } return tree; + } + + @Override + protected String getPath(TreeLocation location) { + Tree tree = location.getTree(); + if (tree == null) { + return location.getPath(); + } + + IdentifierManager idManager = getSessionDelegate().getIdManager(); + String id = idManager.getIdentifier(tree); + return idManager.getLocation(id).getPath(); } // -----------------------------------------------------------< private >--- Index: oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java (date 1362603615000) +++ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/PropertyDelegate.java (date 1362559036000) @@ -25,7 +25,10 @@ import javax.jcr.ValueFormatException; import org.apache.jackrabbit.oak.api.PropertyState; +import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.TreeLocation; +import org.apache.jackrabbit.oak.commons.PathUtils; +import org.apache.jackrabbit.oak.plugins.identifier.IdentifierManager; import org.apache.jackrabbit.oak.plugins.memory.PropertyStates; import org.apache.jackrabbit.oak.plugins.value.ValueFactoryImpl; @@ -109,6 +112,25 @@ */ public void remove() throws InvalidItemStateException { getLocation().remove(); + } + + //------------------------------------------------------------< internal >--- + + @Override + protected String getPath(TreeLocation location) { + Tree tree = location.getParent().getTree(); + if (tree == null) { + return location.getPath(); + } + + PropertyState property = location.getProperty(); + if (property == null) { + return location.getPath(); + } + + IdentifierManager idManager = getSessionDelegate().getIdManager(); + String id = idManager.getIdentifier(tree); + return PathUtils.concat(idManager.getLocation(id).getPath(), property.getName()); } //------------------------------------------------------------< private >--- Index: oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java IDEA additional info: Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP <+>UTF-8 =================================================================== --- oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java (date 1362603615000) +++ oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/MoveTest.java (date 1362559036000) @@ -21,7 +21,6 @@ import org.apache.jackrabbit.JcrConstants; import org.apache.jackrabbit.test.AbstractJCRTest; -import org.junit.Ignore; import org.junit.Test; /** @@ -88,7 +87,6 @@ assertEquals(sourcePath, node1.getPath()); } - @Ignore("OAK-606") @Test public void testMoveReferenceable() throws Exception { Node node1 = testRootNode.addNode(nodeName1); @@ -120,7 +118,6 @@ assertEquals(sourcePath, node1.getPath()); } - @Ignore("OAK-607") @Test public void testMoveNewReferenceable() throws Exception { Node node1 = testRootNode.addNode(nodeName1); \ No newline at end of file