jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1365002 - in /jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query: ./ qom/
Date Tue, 24 Jul 2012 12:17:18 GMT
Author: thomasm
Date: Tue Jul 24 12:17:17 2012
New Revision: 1365002

URL: http://svn.apache.org/viewvc?rev=1365002&view=rev
Log:
OAK-202 Simplify the code when possible

Removed:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMVisitor.java
Modified:
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/DynamicOperandImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinConditionImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/LiteralImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMNode.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SourceImpl.java
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/StaticOperandImpl.java

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/QueryResultImpl.java
Tue Jul 24 12:17:17 2012
@@ -79,7 +79,7 @@ public class QueryResultImpl implements 
 
     @Override
     public RowIterator getRows() throws RepositoryException {
-        Iterator<RowImpl> it = new Iterator<RowImpl>() {
+        Iterator<RowImpl> rowIterator = new Iterator<RowImpl>() {
 
             private final Iterator<? extends ResultRow> it = result.getRows().iterator();
             private RowImpl current;
@@ -90,7 +90,7 @@ public class QueryResultImpl implements 
 
             private void fetch() {
                 current = null;
-                while(it.hasNext()) {
+                while (it.hasNext()) {
                     ResultRow r = it.next();
                     for (String s : getSelectorNames()) {
                         String path = r.getPath(s);
@@ -123,7 +123,7 @@ public class QueryResultImpl implements 
             }
 
         };
-        return new RowIteratorAdapter(it);
+        return new RowIteratorAdapter(rowIterator);
     }
 
     @CheckForNull
@@ -142,7 +142,7 @@ public class QueryResultImpl implements 
             throw new RepositoryException("Query contains more than one selector: " +
                     Arrays.toString(getSelectorNames()));
         }
-        Iterator<NodeImpl> it = new Iterator<NodeImpl>() {
+        Iterator<NodeImpl> nodeIterator = new Iterator<NodeImpl>() {
 
             private final Iterator<? extends ResultRow> it = result.getRows().iterator();
             private NodeImpl current;
@@ -153,7 +153,7 @@ public class QueryResultImpl implements 
 
             private void fetch() {
                 current = null;
-                while(it.hasNext()) {
+                while (it.hasNext()) {
                     ResultRow r = it.next();
                     String path = r.getPath();
                     if (includeRow(path)) {
@@ -184,7 +184,7 @@ public class QueryResultImpl implements 
             }
 
         };
-        return new NodeIteratorAdapter(it);
+        return new NodeIteratorAdapter(nodeIterator);
     }
 
     Value createValue(CoreValue value) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/DynamicOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/DynamicOperandImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/DynamicOperandImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/DynamicOperandImpl.java
Tue Jul 24 12:17:17 2012
@@ -18,6 +18,9 @@ package org.apache.jackrabbit.oak.jcr.qu
 
 import javax.jcr.query.qom.DynamicOperand;
 
+/**
+ * The base class for dynamic operands.
+ */
 public abstract class DynamicOperandImpl extends QOMNode implements DynamicOperand {
 
     // base class without methods

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinConditionImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinConditionImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/JoinConditionImpl.java
Tue Jul 24 12:17:17 2012
@@ -15,6 +15,9 @@ package org.apache.jackrabbit.oak.jcr.qu
 
 import javax.jcr.query.qom.JoinCondition;
 
+/**
+ * The base class for join conditions.
+ */
 public abstract class JoinConditionImpl extends QOMNode implements JoinCondition {
 
     // base class without methods

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/LiteralImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/LiteralImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/LiteralImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/LiteralImpl.java
Tue Jul 24 12:17:17 2012
@@ -78,7 +78,7 @@ public class LiteralImpl extends StaticO
         return "CAST(" + escape(value.getString()) + " AS " + type + ')';
     }
 
-    public static final String escape(String v){
+    public static final String escape(String v) {
         return '\'' + v.replace("'", "''") + '\'';
     }
 

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMNode.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMNode.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMNode.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QOMNode.java
Tue Jul 24 12:17:17 2012
@@ -18,6 +18,9 @@
  */
 package org.apache.jackrabbit.oak.jcr.query.qom;
 
+/**
+ * The base class for all QOM nodes.
+ */
 abstract class QOMNode {
 
     protected String protect(Object expression) {

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/QueryObjectModelImpl.java
Tue Jul 24 12:17:17 2012
@@ -13,7 +13,6 @@
  */
 package org.apache.jackrabbit.oak.jcr.query.qom;
 
-import java.util.ArrayList;
 import java.util.HashMap;
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
@@ -26,7 +25,6 @@ import javax.jcr.query.qom.Column;
 import javax.jcr.query.qom.Constraint;
 import javax.jcr.query.qom.Ordering;
 import javax.jcr.query.qom.QueryObjectModel;
-import javax.jcr.query.qom.Selector;
 import javax.jcr.query.qom.Source;
 import org.apache.jackrabbit.oak.jcr.query.QueryManagerImpl;
 
@@ -35,12 +33,11 @@ import org.apache.jackrabbit.oak.jcr.que
  */
 public class QueryObjectModelImpl implements QueryObjectModel {
 
+    private final Source source;
+    private final Constraint constraint;
+    private final HashMap<String, Value> bindVariableMap = new HashMap<String, Value>();
     private final QueryManagerImpl queryManager;
     private final ValueFactory valueFactory;
-    final Source source;
-    final Constraint constraint;
-    final HashMap<String, Value> bindVariableMap = new HashMap<String, Value>();
-    final ArrayList<Selector> selectors = new ArrayList<Selector>();
     private final Ordering[] orderings;
     private final Column[] columns;
     private long limit = Long.MAX_VALUE;

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SourceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SourceImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SourceImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/SourceImpl.java
Tue Jul 24 12:17:17 2012
@@ -20,6 +20,9 @@ package org.apache.jackrabbit.oak.jcr.qu
 
 import javax.jcr.query.qom.Source;
 
+/**
+ * The base class for sources.
+ */
 public abstract class SourceImpl extends QOMNode implements Source {
 
     // base class without methods

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/StaticOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/StaticOperandImpl.java?rev=1365002&r1=1365001&r2=1365002&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/StaticOperandImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/query/qom/StaticOperandImpl.java
Tue Jul 24 12:17:17 2012
@@ -20,6 +20,9 @@ package org.apache.jackrabbit.oak.jcr.qu
 
 import javax.jcr.query.qom.StaticOperand;
 
+/**
+ * The base class for static operands.
+ */
 public abstract class StaticOperandImpl extends QOMNode implements StaticOperand {
 
     public abstract void bindVariables(QueryObjectModelImpl qom);



Mime
View raw message