jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From resc...@apache.org
Subject svn commit: r1342304 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Date Thu, 24 May 2012 15:50:05 GMT
Author: reschke
Date: Thu May 24 15:50:05 2012
New Revision: 1342304

URL: http://svn.apache.org/viewvc?rev=1342304&view=rev
Log:
OAK-23: implement lookup by identifier using Query (WIP)

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

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java?rev=1342304&r1=1342303&r2=1342304&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/SessionDelegate.java
Thu May 24 15:50:05 2012
@@ -138,7 +138,7 @@ public class SessionDelegate {
         }
         else {
             // referenceable
-            return findByJcrUuid(getTree(""), id);
+            return findByJcrUuid(id);
         }
     }
 
@@ -350,7 +350,7 @@ public class SessionDelegate {
     }
 
     @CheckForNull
-    NodeDelegate findByJcrUuid(Tree tree, String id) {
+    NodeDelegate findByJcrUuid(String id) {
 
         try {
             Map<String, CoreValue> bindings = Collections.singletonMap("id", getValueFactory().getCoreValueFactory()
@@ -377,24 +377,31 @@ public class SessionDelegate {
             log.error("query failed", ex);
             return null;
         }
-
-        // Tree-walking implementation...
-        // PropertyState p = tree.getProperty("jcr:uuid");
-        // if (p != null && id.equals(p.getValue().getString())) {
-        // return new NodeDelegate(this, tree);
-        // }
-        // else {
-        // for (Tree c : tree.getChildren()) {
-        // NodeDelegate found = findByJcrUuid(c, id);
-        // if (found != null) {
-        // return found;
-        // }
-        // }
-        // }
-        //
-        // return null;
     }
 
+//    @CheckForNull
+//    NodeDelegate slowFindByJcrUuid(String id) {
+//        return slowFindByJcrUuid(getTree(""), id);
+//    }
+//
+//    @CheckForNull
+//    NodeDelegate slowFindByJcrUuid(Tree tree, String id) {
+//        // Tree-walking implementation...
+//        PropertyState p = tree.getProperty("jcr:uuid");
+//        if (p != null && id.equals(p.getValue().getString())) {
+//            return new NodeDelegate(this, tree);
+//        } else {
+//            for (Tree c : tree.getChildren()) {
+//                NodeDelegate found = slowFindByJcrUuid(c, id);
+//                if (found != null) {
+//                    return found;
+//                }
+//            }
+//        }
+//
+//        return null;
+//    }
+
     //--------------------------------------------------< SessionNameMapper >---
 
     private class SessionNameMapper extends AbstractNameMapper {



Mime
View raw message