jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1299756 - in /jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query: ParserSQL2.java XPathToSQL2Converter.java reader/TraversingCursor.java
Date Mon, 12 Mar 2012 17:46:34 GMT
Author: mduerig
Date: Mon Mar 12 17:46:33 2012
New Revision: 1299756

URL: http://svn.apache.org/viewvc?rev=1299756&view=rev
Log:
Microkernel based prototype of JCR implementation (WIP)
- use Collection.isEmpty

Modified:
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/ParserSQL2.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/XPathToSQL2Converter.java
    jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/reader/TraversingCursor.java

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/ParserSQL2.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/ParserSQL2.java?rev=1299756&r1=1299755&r2=1299756&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/ParserSQL2.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/ParserSQL2.java
Mon Mar 12 17:46:33 2012
@@ -119,7 +119,7 @@ public class ParserSQL2 {
             read("BY");
             orderings = parseOrder();
         }
-        if (currentToken.length() > 0) {
+        if (!currentToken.isEmpty()) {
             throw getSyntaxError("<end>");
         }
         QueryObjectModelImpl q = factory.createQuery(source, constraint, orderings, columnArray);
@@ -799,7 +799,7 @@ public class ParserSQL2 {
                 i++;
             }
             currentToken = statement.substring(start, i);
-            if (currentToken.length() == 0) {
+            if (currentToken.isEmpty()) {
                 throw getSyntaxError();
             }
             currentTokenType = IDENTIFIER;
@@ -955,7 +955,7 @@ public class ParserSQL2 {
     }
 
     private InvalidQueryException getSyntaxError() {
-        if (expected == null || expected.size() == 0) {
+        if (expected == null || expected.isEmpty()) {
             return getSyntaxError(null);
         } else {
             StringBuilder buff = new StringBuilder();

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/XPathToSQL2Converter.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/XPathToSQL2Converter.java?rev=1299756&r1=1299755&r2=1299756&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/XPathToSQL2Converter.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/XPathToSQL2Converter.java
Mon Mar 12 17:46:33 2012
@@ -147,11 +147,11 @@ public class XPathToSQL2Converter {
                 orderList.add(order);
             } while (readIf(","));
         }
-        if (currentToken.length() > 0) {
+        if (!currentToken.isEmpty()) {
             throw getSyntaxError("<end>");
         }
         StringBuilder buff = new StringBuilder("select ");
-        if (columnList.size() == 0) {
+        if (columnList.isEmpty()) {
             buff.append('*');
         } else {
             for (int i = 0; i < columnList.size(); i++) {
@@ -166,7 +166,7 @@ public class XPathToSQL2Converter {
         if (condition != null) {
             buff.append(" where ").append(condition);
         }
-        if (orderList.size() > 0) {
+        if (!orderList.isEmpty()) {
             buff.append(" order by ");
             for (int i = 0; i < orderList.size(); i++) {
                 if (i > 0) {
@@ -465,7 +465,7 @@ public class XPathToSQL2Converter {
                 i++;
             }
             currentToken = statement.substring(start, i);
-            if (currentToken.length() == 0) {
+            if (currentToken.isEmpty()) {
                 throw getSyntaxError();
             }
             currentTokenType = IDENTIFIER;
@@ -602,7 +602,7 @@ public class XPathToSQL2Converter {
     }
 
     private InvalidQueryException getSyntaxError() {
-        if (expected == null || expected.size() == 0) {
+        if (expected == null || expected.isEmpty()) {
             return getSyntaxError(null);
         } else {
             StringBuilder buff = new StringBuilder();

Modified: jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/reader/TraversingCursor.java
URL: http://svn.apache.org/viewvc/jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/reader/TraversingCursor.java?rev=1299756&r1=1299755&r2=1299756&view=diff
==============================================================================
--- jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/reader/TraversingCursor.java
(original)
+++ jackrabbit/sandbox/jackrabbit-microkernel/src/main/java/org/apache/jackrabbit/query/reader/TraversingCursor.java
Mon Mar 12 17:46:33 2012
@@ -74,7 +74,7 @@ public class TraversingCursor implements
             currentPath = null;
             return false;
         }
-        if (nodes.size() == 0) {
+        if (nodes.isEmpty()) {
             if (!mk.nodeExists(currentPath, revisionId)) {
                 nodes = null;
                 currentPath = null;
@@ -83,7 +83,7 @@ public class TraversingCursor implements
             loadChildren(currentPath, 0);
             return true;
         }
-        while (nodes.size() > 0) {
+        while (!nodes.isEmpty()) {
             // next child node in the deepest level
             NodeCursor c = nodes.get(nodes.size() - 1);
             currentPath = c.node.getPath();



Mime
View raw message