### Eclipse Workspace Patch 1.0 #P oak-core-1.0 Index: src/test/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStorageStrategyTest.java =================================================================== --- src/test/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStorageStrategyTest.java (revision 1630050) +++ src/test/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStorageStrategyTest.java (working copy) @@ -47,7 +47,6 @@ import org.apache.jackrabbit.oak.plugins.index.IndexUtils; import org.apache.jackrabbit.oak.plugins.index.property.OrderedIndex; import org.apache.jackrabbit.oak.plugins.index.property.OrderedIndex.OrderDirection; -import org.apache.jackrabbit.oak.plugins.index.property.strategy.OrderedContentMirrorStoreStrategy.OrderedChildNodeEntry; import org.apache.jackrabbit.oak.plugins.index.property.strategy.OrderedContentMirrorStoreStrategy.PredicateLessThan; import org.apache.jackrabbit.oak.plugins.memory.EmptyNodeState; import org.apache.jackrabbit.oak.query.ast.Operator; @@ -107,9 +106,8 @@ public int getLane() { if (lane == SUPER_LANE) { return super.getLane(); - } else { - return lane; } + return lane; } public void setLane(int lane) { @@ -154,8 +152,8 @@ node = index.getChildNode(no); assertTrue("n0 should exists in the index", node.exists()); - assertEquals("n0 should point nowhere as it's the last (and only) element", "", - Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]); + assertEquals("n0 should point nowhere as it's the last (and only) element", 0, + Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class).length); // checking content structure below n0 node = node.getChildNode(pathNodes[0]); @@ -198,8 +196,8 @@ node = index.getChildNode(n0); assertTrue(":index should have n0", node.exists()); - assertEquals("n0 should point nowhere at this stage", "", - Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]); + assertEquals("n0 should point nowhere at this stage", 0, + Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class).length); // second node arrives store.update(index, path, EMPTY_KEY_SET, newHashSet(n1)); @@ -216,8 +214,8 @@ node = index.getChildNode(n1); assertTrue("n1 should exists", node.exists()); - assertEquals("n1 should point nowhere", "", - Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]); + assertEquals("n1 should point nowhere", 0, + Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class).length); } /** @@ -609,8 +607,8 @@ assertEquals("n2 should be pointing to n0", n0, Iterables.toArray(n.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]); n = index.getChildNode(n0).getNodeState(); - assertTrue("n0 should still be the last item of the list", Strings.isNullOrEmpty(Iterables - .toArray(n.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0])); + assertEquals("n0 should still be the last item of the list", 0, + Iterables.toArray(n.getProperty(NEXT).getValue(Type.STRINGS), String.class).length); // Stage 4 store.update(index, "/a/b", EMPTY_KEY_SET, newHashSet(n3)); @@ -622,8 +620,8 @@ Iterables.toArray(n.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]); assertEquals("n2 should be pointing to n0", n0, getNext(index.getChildNode(n2))); assertEquals("n0 should be pointing to n3", n3, getNext(index.getChildNode(n0))); - assertTrue("n3 should be the last element", - Strings.isNullOrEmpty(getNext(index.getChildNode(n3)))); + assertEquals("n3 should be the last element", "", + getNext(index.getChildNode(n3))); } /** @@ -1593,11 +1591,13 @@ } private static String getNext(@Nonnull NodeState node) { - return Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class)[0]; + String[] array = Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class); + return array.length > 0 ? array[0] : ""; } private static String getNext(@Nonnull NodeState node, int lane) { - return Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class)[lane]; + String[] array = Iterables.toArray(node.getProperty(NEXT).getValue(Type.STRINGS), String.class); + return array.length > lane ? array[lane] : ""; } private static Iterable getMultiNext(@Nonnull NodeState node) { @@ -1611,33 +1611,33 @@ OrderedContentMirrorStoreStrategy.setPropertyNext(n, "foobar"); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("foobar", "", "", ""), + assertEquals(ImmutableList.of("foobar"), n.getProperty(NEXT).getValue(Type.STRINGS)); OrderedContentMirrorStoreStrategy.setPropertyNext(n, (String[]) null); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); assertEquals("If I set a value to null, nothing should change", - ImmutableList.of("foobar", "", "", ""), n.getProperty(NEXT).getValue(Type.STRINGS)); + ImmutableList.of("foobar"), n.getProperty(NEXT).getValue(Type.STRINGS)); OrderedContentMirrorStoreStrategy.setPropertyNext(n, ""); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); OrderedContentMirrorStoreStrategy.setPropertyNext(n, "a", "b"); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "b", "", ""), + assertEquals(ImmutableList.of("a", "b"), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); OrderedContentMirrorStoreStrategy.setPropertyNext(n, "a", "b", "c"); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "b", "c", ""), + assertEquals(ImmutableList.of("a", "b", "c"), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); @@ -1648,14 +1648,6 @@ n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); - OrderedContentMirrorStoreStrategy.setPropertyNext(n, "a", "b", "c", "d", "e", "f"); - assertNotNull(n); - assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals("even if we provide more than 4 nexts we expect it to take only the first 4s", - ImmutableList.of("a", "b", "c", "d"), - n.getProperty(NEXT).getValue(Type.STRINGS)); - - n = EmptyNodeState.EMPTY_NODE.builder(); n.setProperty(NEXT, ImmutableList.of("a", "b", "c", "d"), Type.STRINGS); OrderedContentMirrorStoreStrategy.setPropertyNext(n, "a", 3); assertNotNull(n); @@ -1668,7 +1660,7 @@ OrderedContentMirrorStoreStrategy.setPropertyNext(n, "b", 0); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("b", "", "", ""), + assertEquals(ImmutableList.of("b"), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); @@ -1676,7 +1668,7 @@ OrderedContentMirrorStoreStrategy.setPropertyNext(n, "b", 1); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "b", "", ""), + assertEquals(ImmutableList.of("a", "b"), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); @@ -1684,7 +1676,7 @@ OrderedContentMirrorStoreStrategy.setPropertyNext(n, "b", 2); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "", "b", ""), + assertEquals(ImmutableList.of("a", "", "b"), n.getProperty(NEXT).getValue(Type.STRINGS)); n = EmptyNodeState.EMPTY_NODE.builder(); @@ -1700,16 +1692,9 @@ OrderedContentMirrorStoreStrategy.setPropertyNext(n, "c", 1); assertNotNull(n); assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "c", "", ""), + assertEquals(ImmutableList.of("a", "c"), n.getProperty(NEXT).getValue(Type.STRINGS)); - n = EmptyNodeState.EMPTY_NODE.builder(); - n.setProperty(NEXT, ImmutableList.of("a", "b"), Type.STRINGS); - OrderedContentMirrorStoreStrategy.setPropertyNext(n, "c", 3); - assertNotNull(n); - assertNotNull(":next cannot be null", n.getProperty(NEXT)); - assertEquals(ImmutableList.of("a", "b", "", "c"), - n.getProperty(NEXT).getValue(Type.STRINGS)); } @Test @@ -1740,7 +1725,7 @@ assertEquals("b", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 1)); assertEquals("c", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 2)); assertEquals("d", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 3)); - assertEquals("the highest available lane is expected", "d", + assertEquals("the highest available lane is expected", "", OrderedContentMirrorStoreStrategy.getPropertyNext(node, OrderedIndex.LANES + 100)); node.setProperty(NEXT, "a", Type.STRING); @@ -1754,8 +1739,8 @@ assertEquals("a", OrderedContentMirrorStoreStrategy.getPropertyNext(node)); assertEquals("a", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 0)); assertEquals("b", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 1)); - assertEquals("b", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 2)); - assertEquals("b", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 3)); + assertEquals("", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 2)); + assertEquals("", OrderedContentMirrorStoreStrategy.getPropertyNext(node, 3)); } @Test @@ -1822,12 +1807,12 @@ NodeBuilder n = index.getChildNode(START); assertNotNull("There should always be a :start", n); assertEquals(":start's :next should always point to the first element", - ImmutableList.of(n0, "", "", ""), + ImmutableList.of(n0), n.getProperty(NEXT).getValue(Type.STRINGS) ); n = index.getChildNode(n0); assertNotNull(n); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS) ); @@ -1846,12 +1831,12 @@ n = index.getChildNode(START); assertNotNull("There should always be a :start", n); assertEquals(":start's :next should always point to the first element", - ImmutableList.of(n0, n0, "", ""), + ImmutableList.of(n0, n0), n.getProperty(NEXT).getValue(Type.STRINGS) ); n = index.getChildNode(n0); assertNotNull(n); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS) ); @@ -1870,12 +1855,12 @@ n = index.getChildNode(START); assertNotNull("There should always be a :start", n); assertEquals(":start's :next should always point to the first element", - ImmutableList.of(n0, n0, n0, ""), + ImmutableList.of(n0, n0, n0), n.getProperty(NEXT).getValue(Type.STRINGS) ); n = index.getChildNode(n0); assertNotNull(n); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS) ); @@ -1899,7 +1884,7 @@ ); n = index.getChildNode(n0); assertNotNull(n); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS) ); } @@ -1935,17 +1920,17 @@ n = index.getChildNode(START); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(ImmutableList.of(n0, "", "", ""), n.getProperty(NEXT).getValue(Type.STRINGS)); + assertEquals(ImmutableList.of(n0), n.getProperty(NEXT).getValue(Type.STRINGS)); n = index.getChildNode(n0); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(ImmutableList.of(n1, "", "", ""), n.getProperty(NEXT).getValue(Type.STRINGS)); + assertEquals(ImmutableList.of(n1), n.getProperty(NEXT).getValue(Type.STRINGS)); n = index.getChildNode(n1); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -1966,17 +1951,17 @@ n = index.getChildNode(START); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(ImmutableList.of(n0, n1, "", ""), n.getProperty(NEXT).getValue(Type.STRINGS)); + assertEquals(ImmutableList.of(n0, n1), n.getProperty(NEXT).getValue(Type.STRINGS)); n = index.getChildNode(n0); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(ImmutableList.of(n1, "", "", ""), n.getProperty(NEXT).getValue(Type.STRINGS)); + assertEquals(ImmutableList.of(n1), n.getProperty(NEXT).getValue(Type.STRINGS)); n = index.getChildNode(n1); assertNotNull(n); assertNotNull(n.getProperty(NEXT)); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), n.getProperty(NEXT).getValue(Type.STRINGS)); } @@ -2029,19 +2014,19 @@ descStore.update(descIndex, "/a", EMPTY_KEY_SET, newHashSet(n06)); node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n06, "", "", ""), + assertEquals(ImmutableList.of(n06), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); node = descIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n06, "", "", ""), + assertEquals(ImmutableList.of(n06), node.getProperty(NEXT).getValue(Type.STRINGS)); node = descIndex.getChildNode(n06); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2055,29 +2040,29 @@ index = ascIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, "", ""), + assertEquals(ImmutableList.of(n05, n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, "", "", ""), + assertEquals(ImmutableList.of(n06), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, "", ""), + assertEquals(ImmutableList.of(n06, n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2091,37 +2076,37 @@ index = ascIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, "", ""), + assertEquals(ImmutableList.of(n05, n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, "", "", ""), + assertEquals(ImmutableList.of(n06), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n05, "", ""), + assertEquals(ImmutableList.of(n09, n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n06, "", "", ""), + assertEquals(ImmutableList.of(n06), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2134,45 +2119,45 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, n07, ""), + assertEquals(ImmutableList.of(n05, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, "", ""), + assertEquals(ImmutableList.of(n06, n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(OrderedContentMirrorStoreStrategy.EMPTY_NEXT, + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2186,58 +2171,58 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n03, n03, n03, ""), + assertEquals(ImmutableList.of(n03, n03, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, n07, ""), + assertEquals(ImmutableList.of(n05, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n03, n03, "", ""), + assertEquals(ImmutableList.of(n03, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2250,67 +2235,67 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n01, n01, n03, ""), + assertEquals(ImmutableList.of(n01, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n03, n03, "", ""), + assertEquals(ImmutableList.of(n03, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, n07, ""), + assertEquals(ImmutableList.of(n05, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n03, n03, "", ""), + assertEquals(ImmutableList.of(n03, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n01, n01, "", ""), + assertEquals(ImmutableList.of(n01, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2323,76 +2308,76 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n01, n01, n03, ""), + assertEquals(ImmutableList.of(n01, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n05, n05, n07, ""), + assertEquals(ImmutableList.of(n05, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n03, n03, "", ""), + assertEquals(ImmutableList.of(n03, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2405,85 +2390,85 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n01, n01, n03, ""), + assertEquals(ImmutableList.of(n01, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2496,94 +2481,94 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n01, n01, n03, ""), + assertEquals(ImmutableList.of(n01, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n12, "", "", ""), + assertEquals(ImmutableList.of(n12), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n12, n07, n07, ""), + assertEquals(ImmutableList.of(n12, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2596,103 +2581,103 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n00, n01, n03, ""), + assertEquals(ImmutableList.of(n00, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n12, "", "", ""), + assertEquals(ImmutableList.of(n12), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n12, n07, n07, ""), + assertEquals(ImmutableList.of(n12, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n00, "", "", ""), + assertEquals(ImmutableList.of(n00), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /** @@ -2705,112 +2690,112 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n00, n01, n03, ""), + assertEquals(ImmutableList.of(n00, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n08, "", "", ""), + assertEquals(ImmutableList.of(n08), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n12, "", "", ""), + assertEquals(ImmutableList.of(n12), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n12, n07, n07, ""), + assertEquals(ImmutableList.of(n12, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n08, "", "", ""), + assertEquals(ImmutableList.of(n08), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n00, "", "", ""), + assertEquals(ImmutableList.of(n00), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /** @@ -2823,121 +2808,121 @@ node = ascIndex.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n00, n01, n03, ""), + assertEquals(ImmutableList.of(n00, n01, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n08, "", "", ""), + assertEquals(ImmutableList.of(n08), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n11, "", "", ""), + assertEquals(ImmutableList.of(n11), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n11); assertNotNull(node); - assertEquals(ImmutableList.of(n12, "", "", ""), + assertEquals(ImmutableList.of(n12), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; node = index.getChildNode(START); assertNotNull(node); - assertEquals(ImmutableList.of(n12, n07, n07, ""), + assertEquals(ImmutableList.of(n12, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of(n11, "", "", ""), + assertEquals(ImmutableList.of(n11), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n11); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n08, "", "", ""), + assertEquals(ImmutableList.of(n08), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n00, "", "", ""), + assertEquals(ImmutableList.of(n00), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); /* @@ -2955,67 +2940,67 @@ node = ascIndex.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n03, "", ""), + assertEquals(ImmutableList.of(n02, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n05, n07, ""), + assertEquals(ImmutableList.of(n04, n05, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n07, "", ""), + assertEquals(ImmutableList.of(n06, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n08, n10, n10, ""), + assertEquals(ImmutableList.of(n08, n10, n10), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n09, "", "", ""), + assertEquals(ImmutableList.of(n09), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n10, "", "", ""), + assertEquals(ImmutableList.of(n10), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n10); assertNotNull(node); - assertEquals(ImmutableList.of(n11, "", "", ""), + assertEquals(ImmutableList.of(n11), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n11); assertNotNull(node); - assertEquals(ImmutableList.of(n12, "", "", ""), + assertEquals(ImmutableList.of(n12), node.getProperty(NEXT).getValue(Type.STRINGS)); node = ascIndex.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); index = descIndex; @@ -3025,55 +3010,55 @@ node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n12); assertNotNull(node); - assertEquals(ImmutableList.of(n11, "", "", ""), + assertEquals(ImmutableList.of(n11), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n11); assertNotNull(node); - assertEquals(ImmutableList.of(n10, "", "", ""), + assertEquals(ImmutableList.of(n10), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n10); assertNotNull(node); - assertEquals(ImmutableList.of(n09, n07, n07, ""), + assertEquals(ImmutableList.of(n09, n07, n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n09); assertNotNull(node); - assertEquals(ImmutableList.of(n08, "", "", ""), + assertEquals(ImmutableList.of(n08), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n08); assertNotNull(node); - assertEquals(ImmutableList.of(n07, "", "", ""), + assertEquals(ImmutableList.of(n07), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n07); assertNotNull(node); - assertEquals(ImmutableList.of(n06, n05, n03, ""), + assertEquals(ImmutableList.of(n06, n05, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n06); assertNotNull(node); - assertEquals(ImmutableList.of(n05, "", "", ""), + assertEquals(ImmutableList.of(n05), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n05); assertNotNull(node); - assertEquals(ImmutableList.of(n04, n03, "", ""), + assertEquals(ImmutableList.of(n04, n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n04); assertNotNull(node); - assertEquals(ImmutableList.of(n03, "", "", ""), + assertEquals(ImmutableList.of(n03), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n03); assertNotNull(node); - assertEquals(ImmutableList.of(n02, n01, "", ""), + assertEquals(ImmutableList.of(n02, n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n02); assertNotNull(node); - assertEquals(ImmutableList.of(n01, "", "", ""), + assertEquals(ImmutableList.of(n01), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n01); assertNotNull(node); - assertEquals(ImmutableList.of(n00, "", "", ""), + assertEquals(ImmutableList.of(n00), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n00); assertNotNull(node); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); } @@ -3426,15 +3411,15 @@ node = index.getChildNode(START); assertTrue(node.exists()); - assertEquals(ImmutableList.of(n0, "", "", ""), + assertEquals(ImmutableList.of(n0), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n0); assertTrue(node.exists()); - assertEquals(ImmutableList.of(n1, "", "", ""), + assertEquals(ImmutableList.of(n1), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n1); assertTrue(node.exists()); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n2); assertFalse(node.exists()); @@ -3464,15 +3449,15 @@ // checking key nodes node = index.getChildNode(START); assertTrue(node.exists()); - assertEquals(ImmutableList.of(n0, n1, "", ""), + assertEquals(ImmutableList.of(n0, n1), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n0); assertTrue(node.exists()); - assertEquals(ImmutableList.of(n1, "", "", ""), + assertEquals(ImmutableList.of(n1), node.getProperty(NEXT).getValue(Type.STRINGS)); node = index.getChildNode(n1); assertTrue(node.exists()); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), node.getProperty(NEXT).getValue(Type.STRINGS)); assertFalse(index.hasChildNode(n2)); @@ -3503,51 +3488,51 @@ getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[0]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[1], "", "", ""), + assertEquals(ImmutableList.of(KEYS[1]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[1]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[2], KEYS[3], "", ""), + assertEquals(ImmutableList.of(KEYS[2], KEYS[3]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[2]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[3], "", "", ""), + assertEquals(ImmutableList.of(KEYS[3]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[3]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[4], KEYS[7], KEYS[7], ""), + assertEquals(ImmutableList.of(KEYS[4], KEYS[7], KEYS[7]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[4]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[6], "", "", ""), + assertEquals(ImmutableList.of(KEYS[6]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[6]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[7], "", "", ""), + assertEquals(ImmutableList.of(KEYS[7]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[7]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[8], KEYS[10], KEYS[10], ""), + assertEquals(ImmutableList.of(KEYS[8], KEYS[10], KEYS[10]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[8]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[9], "", "", ""), + assertEquals(ImmutableList.of(KEYS[9]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[9]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[10], "", "", ""), + assertEquals(ImmutableList.of(KEYS[10]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[10]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[11], "", "", ""), + assertEquals(ImmutableList.of(KEYS[11]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[11]); assertTrue(node.exists()); - assertEquals(ImmutableList.of(KEYS[12], "", "", ""), + assertEquals(ImmutableList.of(KEYS[12]), getMultiNext(node.getNodeState())); node = index.getChildNode(KEYS[12]); assertTrue(node.exists()); - assertEquals(ImmutableList.of("", "", "", ""), + assertEquals(ImmutableList.of(), getMultiNext(node.getNodeState())); assertFalse(node.getChildNode(KEYS[5]).exists()); } Index: src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedIndex.java =================================================================== --- src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedIndex.java (revision 1630050) +++ src/main/java/org/apache/jackrabbit/oak/plugins/index/property/OrderedIndex.java (working copy) @@ -136,12 +136,12 @@ *
lane 3:
0.1%
* */ - double DEFAULT_PROBABILITY = 0.1; + double DEFAULT_PROBABILITY = Integer.getInteger("oak.orderedIndex.prob", 3) / 10.0; /** * the number of lanes used in the SkipList */ - int LANES = 4; + int LANES = Integer.getInteger("oak.orderedIndex.lanes", 15); /** * Convenience Predicate that will force the implementor to expose what we're searching for Index: src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStoreStrategy.java =================================================================== --- src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStoreStrategy.java (revision 1630050) +++ src/main/java/org/apache/jackrabbit/oak/plugins/index/property/strategy/OrderedContentMirrorStoreStrategy.java (working copy) @@ -23,6 +23,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.util.ArrayList; import java.util.Collections; import java.util.Deque; import java.util.Iterator; @@ -51,7 +52,6 @@ import com.google.common.base.Charsets; import com.google.common.base.Strings; -import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; @@ -73,7 +73,8 @@ /** * convenience property for initialising an empty multi-value :next */ - public static final Iterable EMPTY_NEXT = ImmutableList.of("", "", "", ""); + public static final Iterable EMPTY_NEXT = + Collections.nCopies(OrderedIndex.LANES, ""); /** * convenience property that represent an empty :next as array @@ -850,10 +851,13 @@ LOG.debug("seek() - plain case"); lane = OrderedIndex.LANES - 1; - + NodeBuilder currentNode = null; do { stillLaning = lane > 0; - nextkey = getPropertyNext(index.getChildNode(currentKey), lane); + if (currentNode == null) { + currentNode = index.getChildNode(currentKey); + } + nextkey = getPropertyNext(currentNode, lane); if ((Strings.isNullOrEmpty(nextkey) || !walkingPredicate.apply(nextkey)) && lane > 0) { // if we're currently pointing to NIL or the next element does not fit the search // but we still have lanes left, let's lower the lane; @@ -863,6 +867,7 @@ found = nextkey; } else { currentKey = nextkey; + currentNode = null; if (keepWalked && !Strings.isNullOrEmpty(currentKey)) { for (int l = lane; l >= 0; l--) { walkedLanes[l] = currentKey; @@ -1055,12 +1060,18 @@ */ static void setPropertyNext(@Nonnull final NodeBuilder node, final String... next) { if (node != null && next != null) { - String n1 = (next.length > 0) ? next[0] : ""; - String n2 = (next.length > 1) ? next[1] : ""; - String n3 = (next.length > 2) ? next[2] : ""; - String n4 = (next.length > 3) ? next[3] : ""; - - node.setProperty(NEXT, ImmutableList.of(n1, n2, n3, n4), Type.STRINGS); + int len = next.length - 1; + for (; len >= 0; len--) { + if (next[len].length() != 0) { + break; + } + } + len++; + List list = new ArrayList(len); + for (int i = 0; i < len; i++) { + list.add(next[i]); + } + node.setProperty(NEXT, list, Type.STRINGS); } } @@ -1085,7 +1096,7 @@ // content LOG.debug("topping-up the number of lanes."); List vv = Lists.newArrayList(values); - for (int i = vv.size(); i <= OrderedIndex.LANES; i++) { + for (int i = vv.size(); i < OrderedIndex.LANES; i++) { vv.add(""); } values = vv.toArray(new String[0]); @@ -1134,7 +1145,10 @@ PropertyState ps = node.getProperty(NEXT); if (ps != null) { if (ps.isArray()) { - next = ps.getValue(Type.STRING, Math.min(ps.count() - 1, lane)); + int count = ps.count(); + if (count > 0 && count > lane) { + next = ps.getValue(Type.STRING, lane); + } } else { next = ps.getValue(Type.STRING); }