jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alexparvule...@apache.org
Subject svn commit: r1482879 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
Date Wed, 15 May 2013 14:58:53 GMT
Author: alexparvulescu
Date: Wed May 15 14:58:53 2013
New Revision: 1482879

URL: http://svn.apache.org/r1482879
Log:
OAK-807 Keep original xpath query as a comment appended to the generated sql2 query

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java?rev=1482879&r1=1482878&r2=1482879&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
Wed May 15 14:58:53 2013
@@ -809,10 +809,12 @@ public class SQL2Parser {
 
     private void parseComment() throws ParseException {
         if (readIf("/") && readIf("*")) {
-            while (!(readIf("*") && readIf("/"))) {
-                if (!isToken("*")) {
-                    read();
-                }
+            //skip to the end directly
+            parseIndex = characterTypes.length - 3;
+            read();
+            boolean endComment = readIf("*") && readIf("/");
+            if (!endComment) {
+                throw getSyntaxError("end of comment");
             }
         }
     }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java?rev=1482879&r1=1482878&r2=1482879&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/SQL2ParserTest.java
Wed May 15 14:58:53 2013
@@ -43,4 +43,10 @@ public class SQL2ParserTest {
         p.parse("select [jcr:path], [jcr:score], * from [nt:base] as a /* xpath: //* ");
     }
 
+    @Test
+    public void testTransformAndParse() throws ParseException {
+        p.parse(new XPathToSQL2Converter()
+                .convert("/jcr:root/test/*/nt:resource[@jcr:encoding]"));
+    }
+
 }



Mime
View raw message