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 md...@apache.org on 2013/04/24 18:37:44 UTC

svn commit: r1471521 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java

Author: mduerig
Date: Wed Apr 24 16:37:43 2013
New Revision: 1471521

URL: http://svn.apache.org/r1471521
Log:
OAK-144: Implement observation
OAK-618: ChangeProcessor must ignore hidden properties
ignore hidden children of added/removed nodes

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java?rev=1471521&r1=1471520&r2=1471521&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/observation/ChangeProcessor.java Wed Apr 24 16:37:43 2013
@@ -31,10 +31,10 @@ import com.google.common.base.Function;
 import com.google.common.base.Predicate;
 import com.google.common.collect.Iterators;
 import org.apache.jackrabbit.commons.iterator.EventIteratorAdapter;
-import org.apache.jackrabbit.oak.spi.observation.ChangeExtractor;
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.namepath.NamePathMapper;
+import org.apache.jackrabbit.oak.spi.observation.ChangeExtractor;
 import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
 import org.apache.jackrabbit.oak.spi.state.NodeStateDiff;
@@ -296,7 +296,13 @@ class ChangeProcessor implements Runnabl
 
         private Iterator<Iterator<Event>> generateChildEvents(final int eventType, final String parentPath, NodeState node) {
             return Iterators.transform(
-                    node.getChildNodeEntries().iterator(),
+                    Iterators.filter(node.getChildNodeEntries().iterator(),
+                        new Predicate<ChildNodeEntry>() {
+                            @Override
+                            public boolean apply(ChildNodeEntry entry) {
+                                return !NodeStateUtils.isHidden(entry.getName());
+                            }
+                    }),
                     new Function<ChildNodeEntry, Iterator<Event>>() {
                         @Override
                         public Iterator<Event> apply(ChildNodeEntry entry) {