jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1456042 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java
Date Wed, 13 Mar 2013 16:38:05 GMT
Author: jukka
Date: Wed Mar 13 16:38:04 2013
New Revision: 1456042

URL: http://svn.apache.org/r1456042
Log:
OAK-698: Optimize handling of empty node states

MemoryNodeState can now be made package-private

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java?rev=1456042&r1=1456041&r2=1456042&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeState.java
Wed Mar 13 16:38:04 2013
@@ -29,13 +29,10 @@ import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
-
 /**
  * Basic in-memory node state implementation.
  */
-public class MemoryNodeState extends AbstractNodeState {
-
-    public static final NodeState EMPTY_NODE = EmptyNodeState.EMPTY_NODE;
+class MemoryNodeState extends AbstractNodeState {
 
     private final Map<String, PropertyState> properties;
 

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java?rev=1456042&r1=1456041&r2=1456042&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/kernel/JsopDiffTest.java
Wed Mar 13 16:38:04 2013
@@ -16,13 +16,12 @@
  */
 package org.apache.jackrabbit.oak.kernel;
 
-import com.google.common.collect.ImmutableMap;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.plugins.memory.BooleanPropertyState;
 import org.apache.jackrabbit.oak.plugins.memory.DoublePropertyState;
 import org.apache.jackrabbit.oak.plugins.memory.LongPropertyState;
-import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeState;
 import org.apache.jackrabbit.oak.plugins.memory.StringPropertyState;
+import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.junit.Test;
 
@@ -61,11 +60,10 @@ public class JsopDiffTest {
     public void testNodeChanges() {
         JsopDiff diff;
         NodeState before = EMPTY_NODE;
-        NodeState after = new MemoryNodeState(
-                ImmutableMap.<String, PropertyState>of(
-                        "a", LongPropertyState.createLongProperty("a", 1L)),
-                ImmutableMap.of("x", EMPTY_NODE));
-
+        NodeBuilder builder = before.builder();
+        builder.setProperty("a", 1L);
+        builder.child("x");
+        NodeState after = builder.getNodeState();
 
         diff = new JsopDiff(null);
         diff.childNodeAdded("test", before);



Mime
View raw message