jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1376856 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
Date Fri, 24 Aug 2012 08:12:21 GMT
Author: mduerig
Date: Fri Aug 24 08:12:21 2012
New Revision: 1376856

URL: http://svn.apache.org/viewvc?rev=1376856&view=rev
Log:
OAK-275 Introduce TreeLocation interface
refactor duplicate code

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java?rev=1376856&r1=1376855&r2=1376856&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeDelegate.java
Fri Aug 24 08:12:21 2012
@@ -119,7 +119,7 @@ public class NodeDelegate extends ItemDe
      */
     @CheckForNull
     public PropertyDelegate getProperty(String relPath) {
-        TreeLocation propertyLocation = getLocation().getChild(relPath);
+        TreeLocation propertyLocation = getChildLocation(relPath);
         PropertyState propertyState = propertyLocation.getProperty();
         return propertyState == null
                 ? null
@@ -152,7 +152,7 @@ public class NodeDelegate extends ItemDe
      */
     @CheckForNull
     public NodeDelegate getChild(String relPath) {
-        Tree tree = getLocation().getChild(relPath).getTree();
+        Tree tree = getChildLocation(relPath).getTree();
         return tree == null ? null : new NodeDelegate(sessionDelegate, tree);
     }
 
@@ -320,7 +320,7 @@ public class NodeDelegate extends ItemDe
         getTree().remove();
     }
 
-    // -----------------------------------------------------------< private >---
+    //------------------------------------------------------------< internal >---
 
     @Nonnull
     Tree getTree() throws InvalidItemStateException {
@@ -334,6 +334,12 @@ public class NodeDelegate extends ItemDe
         }
     }
 
+    // -----------------------------------------------------------< private >---
+
+    private TreeLocation getChildLocation(String relPath) {
+        return getLocation().getChild(relPath);
+    }
+
     @Nonnull
     private TreeLocation getLocation() {
         resolve();



Mime
View raw message