You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by ju...@apache.org on 2013/04/10 10:31:42 UTC

svn commit: r1466379 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/state/AbstractNodeState.java

Author: jukka
Date: Wed Apr 10 08:31:42 2013
New Revision: 1466379

URL: http://svn.apache.org/r1466379
Log:
OAK-765: AbstractNodeState#getChildNode returns null despite @Nonnull return value

Drop the AbstractNodeState.getChildNode() method as nobody is using
the method and returning EmptyNodeState.MISSING would break package
boundaries (Oak SPI should not depend on other non-API classes).

Modified:
    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/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=1466379&r1=1466378&r2=1466379&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 Wed Apr 10 08:31:42 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.jackrabbit.oak.spi.state;
 
-import static com.google.common.base.Preconditions.checkNotNull;
-
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.Set;
@@ -34,10 +32,10 @@ import org.apache.jackrabbit.oak.api.Pro
  * <p>
  * This class also implements trivial (and potentially very slow) versions of
  * the {@link #getProperty(String)} and {@link #getPropertyCount()} methods
- * based on {@link #getProperties()}. The {@link #getChildNode(String)} and
- * {@link #getChildNodeCount()} methods are similarly implemented based on
- * {@link #getChildNodeEntries()}. Subclasses should normally
- * override these method with a more efficient alternatives.
+ * based on {@link #getProperties()}. The {@link #getChildNodeCount()} method
+ * is similarly implemented based on {@link #getChildNodeEntries()}.
+ * Subclasses should normally override these method with a more efficient
+ * alternatives.
  */
 public abstract class AbstractNodeState implements NodeState {
 
@@ -62,17 +60,6 @@ public abstract class AbstractNodeState 
     }
 
     @Override
-    public NodeState getChildNode(String name) {
-        checkNotNull(name);
-        for (ChildNodeEntry entry : getChildNodeEntries()) {
-            if (name.equals(entry.getName())) {
-                return entry.getNodeState();
-            }
-        }
-        return null;
-    }
-
-    @Override
     public long getChildNodeCount() {
         return count(getChildNodeEntries());
     }