jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1373351 - /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Date Wed, 15 Aug 2012 11:45:40 GMT
Author: mduerig
Date: Wed Aug 15 11:45:40 2012
New Revision: 1373351

URL: http://svn.apache.org/viewvc?rev=1373351&view=rev
Log:
OAK-101: implement identifier handling (byUUID, byIdentifier, etc)
simplify by using predicate provided by Guava

Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1373351&r1=1373350&r2=1373351&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Wed Aug 15 11:45:40 2012
@@ -24,9 +24,9 @@ import java.util.Collections;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+
 import javax.annotation.CheckForNull;
 import javax.annotation.Nonnull;
-import javax.annotation.Nullable;
 import javax.jcr.AccessDeniedException;
 import javax.jcr.Binary;
 import javax.jcr.InvalidItemStateException;
@@ -55,6 +55,7 @@ import javax.jcr.version.VersionHistory;
 
 import com.google.common.base.Function;
 import com.google.common.base.Predicate;
+import com.google.common.base.Predicates;
 import com.google.common.collect.Iterables;
 import com.google.common.collect.Iterators;
 import org.apache.jackrabbit.commons.ItemNameMatcher;
@@ -775,17 +776,11 @@ public class NodeImpl extends ItemImpl<N
                 }
         );
 
-        final Predicate ignoreNull = new Predicate() {
-            @Override
-            public boolean apply(@Nullable Object o) {
-                return o != null;
-            }
-        };
-
         return sessionDelegate.perform(new SessionOperation<PropertyIterator>() {
             @Override
             public PropertyIterator perform() {
-                return new PropertyIteratorAdapter(Iterables.filter(properties, ignoreNull).iterator(),
propertyOakPaths.size());
+                return new PropertyIteratorAdapter(
+                        Iterables.filter(properties, Predicates.<Property>notNull()).iterator(),
propertyOakPaths.size());
             }
         });
     }



Mime
View raw message