chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1087284 - /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java
Date Thu, 31 Mar 2011 12:55:59 GMT
Author: jens
Date: Thu Mar 31 12:55:59 2011
New Revision: 1087284

URL: http://svn.apache.org/viewvc?rev=1087284&view=rev
Log:
Use ANTLRStringStream instead of ANTLRInputStream for Lexer. Apply patch CMIS-344

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java?rev=1087284&r1=1087283&r2=1087284&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/query/QueryUtil.java
Thu Mar 31 12:55:59 2011
@@ -18,7 +18,10 @@
  */
 package org.apache.chemistry.opencmis.server.support.query;
 
-import org.antlr.runtime.ANTLRInputStream;
+import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+
+import org.antlr.runtime.ANTLRStringStream;
 import org.antlr.runtime.BaseRecognizer;
 import org.antlr.runtime.CharStream;
 import org.antlr.runtime.CommonTokenStream;
@@ -31,10 +34,6 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.exceptions.CmisInvalidArgumentException;
 import org.apache.chemistry.opencmis.server.support.query.CmisQlStrictParser_CmisBaseGrammar.query_return;
 
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-
 /**
  * Utility class providing convenience methods for parsing CMIS queries. 
  *
@@ -46,7 +45,7 @@ public class QueryUtil {
     // convenience method because everybody needs this piece of code
     public static CmisQueryWalker getWalker(String statement) throws UnsupportedEncodingException,
IOException, RecognitionException {
         
-        CharStream input = new ANTLRInputStream(new ByteArrayInputStream(statement.getBytes("UTF-8")));
+        CharStream input = new ANTLRStringStream(statement);
         TokenSource lexer = new CmisQlStrictLexer(input);
         TokenStream tokens = new CommonTokenStream(lexer);
         CmisQlStrictParser parser = new CmisQlStrictParser(tokens);



Mime
View raw message