jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1299753 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query: RangeIteratorImpl.java qom/QueryObjectModelImpl.java qom/tree/ComparisonImpl.java qom/tree/EquiJoinConditionImpl.java
Date Mon, 12 Mar 2012 17:40:01 GMT
Author: mduerig
Date: Mon Mar 12 17:40:00 2012
New Revision: 1299753

URL: http://svn.apache.org/viewvc?rev=1299753&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- don't call overrideable method from constructor
- use for each loop
- simplify if statements

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/RangeIteratorImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/QueryObjectModelImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/ComparisonImpl.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/EquiJoinConditionImpl.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/RangeIteratorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/RangeIteratorImpl.java?rev=1299753&r1=1299752&r2=1299753&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/RangeIteratorImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/RangeIteratorImpl.java
Mon Mar 12 17:40:00 2012
@@ -16,10 +16,10 @@
  */
 package org.apache.jackrabbit.query;
 
-import java.util.Iterator;
-import java.util.NoSuchElementException;
 import javax.jcr.RangeIterator;
 import javax.jcr.RepositoryException;
+import java.util.Iterator;
+import java.util.NoSuchElementException;
 
 /**
  * The implementation of the corresponding JCR interface.
@@ -43,7 +43,7 @@ public abstract class RangeIteratorImpl<
         return false;
     }
 
-    void fetchNext() {
+    final void fetchNext() {
         try {
             while (true) {
                 if (!iterator.hasNext()) {

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/QueryObjectModelImpl.java?rev=1299753&r1=1299752&r2=1299753&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/QueryObjectModelImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/QueryObjectModelImpl.java
Mon Mar 12 17:40:00 2012
@@ -13,18 +13,6 @@
  */
 package org.apache.jackrabbit.query.qom;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Value;
-import javax.jcr.ValueFactory;
-import javax.jcr.query.QueryResult;
-import javax.jcr.query.Row;
-import javax.jcr.query.qom.QueryObjectModel;
 import org.apache.jackrabbit.commons.SimpleValueFactory;
 import org.apache.jackrabbit.mk.api.MicroKernel;
 import org.apache.jackrabbit.query.RowImpl;
@@ -52,6 +40,19 @@ import org.apache.jackrabbit.query.qom.t
 import org.apache.jackrabbit.query.qom.tree.SourceImpl;
 import org.apache.jackrabbit.query.qom.tree.UpperCaseImpl;
 
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Value;
+import javax.jcr.ValueFactory;
+import javax.jcr.query.QueryResult;
+import javax.jcr.query.Row;
+import javax.jcr.query.qom.QueryObjectModel;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Iterator;
+
 /**
  * The implementation of the corresponding JCR interface. Lifecycle: use the
  * constructor to create a new object. Call init() to initialize the bind
@@ -214,8 +215,8 @@ public class QueryObjectModelImpl implem
 
         }.visit(this);
         source.init(this);
-        for (int i = 0; i < columns.length; i++) {
-            columns[i].bindSelector(source);
+        for (ColumnImpl column : columns) {
+            column.bindSelector(source);
         }
     }
 

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/ComparisonImpl.java?rev=1299753&r1=1299752&r2=1299753&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/ComparisonImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/ComparisonImpl.java
Mon Mar 12 17:40:00 2012
@@ -119,10 +119,7 @@ public class ComparisonImpl extends Cons
         }
 
         boolean matches(String value) {
-            if (invalidPattern) {
-                return false;
-            }
-            return compareAt(value, 0, 0, value.length(), patternChars, patternTypes);
+            return !invalidPattern && compareAt(value, 0, 0, value.length(), patternChars,
patternTypes);
         }
 
         private static boolean compare(char[] pattern, String s, int pi, int si) {

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/EquiJoinConditionImpl.java?rev=1299753&r1=1299752&r2=1299753&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/EquiJoinConditionImpl.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/qom/tree/EquiJoinConditionImpl.java
Mon Mar 12 17:40:00 2012
@@ -91,10 +91,7 @@ public class EquiJoinConditionImpl exten
         }
         // TODO data type mapping
         Value v2 = selector2.currentProperty(property2Name);
-        if (v2 == null) {
-            return false;
-        }
-        return v1.equals(v2);
+        return v2 != null && v1.equals(v2);
     }
 
 }



Mime
View raw message