jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1449058 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: plugins/memory/MemoryNodeBuilder.java spi/state/AbstractNodeState.java
Date Fri, 22 Feb 2013 14:28:10 GMT
Author: alexparvulescu
Date: Fri Feb 22 14:28:10 2013
New Revision: 1449058

URL: http://svn.apache.org/r1449058
Log:
OAK-648 Remove circular dependency in AbstractNodeState

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java?rev=1449058&r1=1449057&r2=1449058&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java
Fri Feb 22 14:28:10 2013
@@ -26,6 +26,7 @@ import com.google.common.collect.Maps;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.api.Type;
 import org.apache.jackrabbit.oak.spi.state.AbstractNodeState;
+import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeBuilder;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
@@ -593,6 +594,12 @@ public class MemoryNodeBuilder implement
             return withNodes(base, copy).getChildNodeNames();
         }
 
+        @Override @Nonnull
+        public Iterable<? extends ChildNodeEntry> getChildNodeEntries() {
+            Map<String, MutableNodeState> copy = Maps.newHashMap(nodes);
+            return withNodes(base, copy).getChildNodeEntries();
+        }
+
         @Override
         public void compareAgainstBaseState(NodeState base, NodeStateDiff diff) {
             with(this.base, properties, nodes).compareAgainstBaseState(base, diff);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java?rev=1449058&r1=1449057&r2=1449058&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java
Fri Feb 22 14:28:10 2013
@@ -28,8 +28,6 @@ import java.util.Iterator;
 import java.util.Set;
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import javax.annotation.Nonnull;
-
 /**
  * Abstract base class for {@link NodeState} implementations.
  * This base class contains default implementations of the
@@ -93,27 +91,6 @@ public abstract class AbstractNodeState 
                 });
     }
 
-    @Override
-    public Iterable<? extends ChildNodeEntry> getChildNodeEntries() {
-        return Iterables.transform(
-                getChildNodeNames(),
-                new Function<String, ChildNodeEntry>() {
-                    @Override
-                    public ChildNodeEntry apply(final String input) {
-                        return new AbstractChildNodeEntry() {
-                            @Override @Nonnull
-                            public String getName() {
-                                return input;
-                            }
-                            @Override @Nonnull
-                            public NodeState getNodeState() {
-                                return getChildNode(input);
-                            }
-                        };
-                    }
-                });
-    }
-
     /**
      * Generic default comparison algorithm that simply walks through the
      * property and child node lists of the given base state and compares



Mime
View raw message