Author: chetanm
Date: Wed Oct 19 15:06:45 2016
New Revision: 1765619

URL: http://svn.apache.org/viewvc?rev=1765619&view=rev
Log:
OAK-1312 -  [bundling] Bundle nodes into a document

Rename the matcher name

Modified:
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingHandler.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcher.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/IncludeMatcher.java
    
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/Matcher.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcherTest.java
    
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/MatcherTest.java

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingHandler.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingHandler.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingHandler.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingHandler.java
 Wed Oct 19 15:06:45 2016
@@ -22,8 +22,6 @@ package org.apache.jackrabbit.oak.plugin
 import java.util.Collections;
 import java.util.Set;
 
-import javax.annotation.CheckForNull;
-
 import org.apache.jackrabbit.oak.api.PropertyState;
 import org.apache.jackrabbit.oak.commons.PathUtils;
 import org.apache.jackrabbit.oak.spi.state.NodeState;
@@ -90,6 +88,7 @@ public class BundlingHandler {
         Matcher childMatcher = ctx.matcher.next(name);
         if (childMatcher.isMatch()) {
             //TODO Add meta prop for bundled child node
+            //TODO Delete should nullify all properties
             childContext = createChildContext(childMatcher);
         } else {
             childContext = getBundlorContext(childPath, state);
@@ -136,7 +135,7 @@ public class BundlingHandler {
     }
 
     private static class BundlingContext {
-        static final BundlingContext NULL = new BundlingContext("", 
Matcher.FAILED);
+        static final BundlingContext NULL = new BundlingContext("", 
Matcher.NON_MATCHING);
         final String bundlingPath;
         final Matcher matcher;
 

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcher.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcher.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcher.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcher.java
 Wed Oct 19 15:06:45 2016
@@ -31,7 +31,7 @@ class CompositeMatcher implements Matche
     public static Matcher compose(List<Matcher> matchers){
         switch (matchers.size()) {
             case 0:
-                return Matcher.FAILED;
+                return Matcher.NON_MATCHING;
             case 1:
                 return matchers.get(0);
             default:

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/IncludeMatcher.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/IncludeMatcher.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/IncludeMatcher.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/IncludeMatcher.java
 Wed Oct 19 15:06:45 2016
@@ -47,10 +47,10 @@ class IncludeMatcher implements Matcher
                 }
                 return new IncludeMatcher(include, depth + 1, nextPath);
             } else {
-                return Matcher.FAILED;
+                return Matcher.NON_MATCHING;
             }
         }
-        return Matcher.FAILED;
+        return Matcher.NON_MATCHING;
     }
 
     @Override

Modified: 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/Matcher.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/Matcher.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/Matcher.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/document/bundlor/Matcher.java
 Wed Oct 19 15:06:45 2016
@@ -20,10 +20,10 @@
 package org.apache.jackrabbit.oak.plugins.document.bundlor;
 
 public interface Matcher {
-    Matcher FAILED = new Matcher() {
+    Matcher NON_MATCHING = new Matcher() {
         @Override
         public Matcher next(String name) {
-            return FAILED;
+            return NON_MATCHING;
         }
 
         @Override

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcherTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcherTest.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcherTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/CompositeMatcherTest.java
 Wed Oct 19 15:06:45 2016
@@ -36,7 +36,7 @@ public class CompositeMatcherTest {
 
     @Test(expected = IllegalArgumentException.class)
     public void multiWithFailing() throws Exception{
-        CompositeMatcher.compose(asList(new Include("x").createMatcher(), 
Matcher.FAILED));
+        CompositeMatcher.compose(asList(new Include("x").createMatcher(), 
Matcher.NON_MATCHING));
     }
 
     @Test

Modified: 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/MatcherTest.java
URL: 
http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/MatcherTest.java?rev=1765619&r1=1765618&r2=1765619&view=diff
==============================================================================
--- 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/MatcherTest.java
 (original)
+++ 
jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/MatcherTest.java
 Wed Oct 19 15:06:45 2016
@@ -27,13 +27,13 @@ public class MatcherTest {
 
     @Test
     public void failingMatcher() throws Exception{
-        assertFalse(Matcher.FAILED.isMatch());
-        assertFalse(Matcher.FAILED.next("x").isMatch());
+        assertFalse(Matcher.NON_MATCHING.isMatch());
+        assertFalse(Matcher.NON_MATCHING.next("x").isMatch());
     }
 
     @Test(expected = IllegalStateException.class)
     public void failingMatcherInvalidPath() throws Exception{
-        Matcher.FAILED.getMatchedPath();
+        Matcher.NON_MATCHING.getMatchedPath();
     }
 
     @Test


Reply via email to