jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r1342719 - /jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Date Fri, 25 May 2012 16:43:14 GMT
Author: stefan
Date: Fri May 25 16:43:13 2012
New Revision: 1342719

URL: http://svn.apache.org/viewvc?rev=1342719&view=rev
Log:
OAK-116: MicroKernel API: clarify semantics of getNodes depth, offset and count parameters

Modified:
    jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java

Modified: jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java?rev=1342719&r1=1342718&r2=1342719&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-mk/src/main/java/org/apache/jackrabbit/mk/core/MicroKernelImpl.java
Fri May 25 16:43:13 2012
@@ -321,18 +321,18 @@ public class MicroKernelImpl implements 
 
         Id revId = revisionId == null ? getHeadRevisionId() : Id.fromString(revisionId);
 
+        NodeFilter nodeFilter = filter == null || filter.isEmpty() ? null : NodeFilter.parse(filter);
+        if (offset > 0 && nodeFilter != null && nodeFilter.getChildNodeFilter()
!= null) {
+            // both an offset > 0 and a filter on node names have been specified...
+            throw new IllegalArgumentException("offset > 0 with child node filter");
+        }
+
         try {
             NodeState nodeState = rep.getNodeState(revId, path);
             if (nodeState == null) {
                 return null;
             }
 
-            NodeFilter nodeFilter = filter == null || filter.isEmpty() ? null : NodeFilter.parse(filter);
-            if (offset > 0 && nodeFilter != null && nodeFilter.getChildNodeFilter()
!= null) {
-                // both an offset > 0 and a filter on node names have been specified...
-                throw new IllegalArgumentException("offset > 0 with child node filter");
-            }
-
             JsopBuilder buf = new JsopBuilder().object();
             toJson(buf, nodeState, depth, (int) offset, maxChildNodes, true, nodeFilter);
             return buf.endObject().toString();
@@ -650,7 +650,7 @@ public class MicroKernelImpl implements 
             this.propFilter = propFilter;
         }
 
-        static NodeFilter parse(String json) throws Exception {
+        static NodeFilter parse(String json) {
             // parse json format filter
             JsopTokenizer t = new JsopTokenizer(json);
             t.read('{');



Mime
View raw message