lucene2 (2.9.4+ds1-4) 11_fix-javacc-generated-files.dpatch

Summary

 contrib/queryparser/build.xml |   11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 11_fix-javacc-generated-files.dpatch by Jan-Pascal van Best <janpascal@vanbest.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad lucene2~/contrib/queryparser/build.xml lucene2/contrib/queryparser/build.xml
--- lucene2~/contrib/queryparser/build.xml	2009-10-08 18:23:39.000000000 +0200
+++ lucene2/contrib/queryparser/build.xml	2009-10-08 18:24:45.000000000 +0200
@@ -54,8 +54,8 @@
   	                         match="^  public ParseException\(Token currentTokenVal.*$(\s\s[^}].*\n)*  \}"
   	                         replace="  public ParseException(Token currentTokenVal,&#10;
   	        int[][] expectedTokenSequencesVal, String[] tokenImageVal) {&#10;
-  	    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, initialise(&#10;
-  	      currentTokenVal, expectedTokenSequencesVal, tokenImageVal)));&#10;
+  	    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, new Object[]{initialise(&#10;
+  	      currentTokenVal, expectedTokenSequencesVal, tokenImageVal)}));&#10;
   	    this.currentToken = currentTokenVal;&#10;
   	    this.expectedTokenSequences = expectedTokenSequencesVal;&#10;
   	    this.tokenImage = tokenImageVal;&#10;
@@ -72,7 +72,7 @@
   	    <replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/ParseException.java"
   	                         match="^  public ParseException\(\).*$(\s\s[^}].*\n)*  \}"
   	                         replace="  public ParseException() {&#10;
-  	    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, &quot;Error&quot;));&#10;
+  	    super(new MessageImpl(QueryParserMessages.INVALID_SYNTAX, new Object[]{&quot;Error&quot;}));&#10;
   	  }"
   	                         flags="gm"
   	                         byline="false"/>
@@ -88,6 +88,11 @@
   	                         replace="  static private String add_escapes(String str) {"
   	                         flags="g"
   	                         byline="false"/>
+  	    <replaceregexp file="src/java/org/apache/lucene/queryParser/standard/parser/StandardSyntaxParser.java"
+  	                         match="Message message = new MessageImpl\(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, query, tme.getMessage\(\)\);"
+  	                         replace="Message message = new MessageImpl(QueryParserMessages.INVALID_SYNTAX_CANNOT_PARSE, new Object[]{query, tme.getMessage()});"
+  	                         flags="g"
+  	                         byline="false"/>
   </target>
 
 </project>