jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330829 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
Date Thu, 26 Apr 2012 13:05:25 GMT
Author: mduerig
Date: Thu Apr 26 13:05:24 2012
New Revision: 1330829

URL: http://svn.apache.org/viewvc?rev=1330829&view=rev
Log:
OAK-30: Strongly typed wrapper for the MicroKernel
Fix error where Integer.MAX was requested instead of -1

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java?rev=1330829&r1=1330828&r2=1330829&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/kernel/KernelNodeState.java
Thu Apr 26 13:05:24 2012
@@ -149,12 +149,17 @@ class KernelNodeState extends AbstractNo
     public Iterable<? extends ChildNodeEntry> getChildNodeEntries(
             long offset, int count) {
         init();
+        boolean all;
         if (count == -1) {
             count = Integer.MAX_VALUE;
+            all = true;
             if (childNodeCount > count) {
                 throw new RuntimeException("Too many child nodes");
             }
         }
+        else {
+            all = false;
+        }
 
         List<ChildNodeEntry> entries = new ArrayList<ChildNodeEntry>();
 
@@ -176,7 +181,7 @@ class KernelNodeState extends AbstractNo
 
         if (count > 0 && childNodeCount > MAX_CHILD_NODE_NAMES) {
             String json = kernel.getNodes(
-                    path, revision, 0, offset, count, null);
+                    path, revision, 0, offset, all ? -1 : count, null);
 
             JsopReader reader = new JsopTokenizer(json);
             reader.read('{');

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java?rev=1330829&r1=1330828&r2=1330829&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/LargeKernelNodeStateTest.java
Thu Apr 26 13:05:24 2012
@@ -19,7 +19,6 @@
 package org.apache.jackrabbit.oak.kernel;
 
 import org.apache.jackrabbit.oak.core.AbstractOakTest;
-import org.junit.Ignore;
 import org.junit.Test;
 
 import static junit.framework.Assert.assertEquals;
@@ -66,7 +65,6 @@ public class LargeKernelNodeStateTest ex
         assertEquals(N + 1, count);
     }
 
-    @Ignore // TODO
     @Test
     @SuppressWarnings("unused")
     public void testGetChildNodeEntriesWithOffset() {



Mime
View raw message