Buggy code:
public class QueryParser implements QueryParserConstants { private static final int CONJ_NONE = 0 ; private static final int CONJ_AND = 1 ; private static final int CONJ_OR = 2 ; private static final int MOD_NONE = 0 ; private static final int MOD_NOT = 10 ; private static final int MOD_REQ = 11 ; public static final QueryParser . Operator AND_OPERATOR = QueryParser . Operator . AND ; public static final QueryParser . Operator OR_OPERATOR = QueryParser . Operator . OR ; private QueryParser . Operator operator = QueryParser . OR_OPERATOR ; boolean lowercaseExpandedTerms = true ; boolean useOldRangeQuery = false ; boolean allowLeadingWildcard = false ; Analyzer analyzer ; String field ; int phraseSlop = 0 ; float fuzzyMinSim = FuzzyQuery . defaultMinSimilarity ; int fuzzyPrefixLength = FuzzyQuery . defaultPrefixLength ; Locale locale = Locale . getDefault ( ) ; Resolution dateResolution = null ; Map fieldToDateResolution = null ; public static final class Operator extends Parameter { private Operator ( String name ) { } public static final QueryParser . Operator OR = new QueryParser . Operator ( "OR" ) ; public static final QueryParser . Operator AND = new QueryParser . Operator ( "AND" ) ; } public QueryParser ( String f , Analyzer a ) { } public Query parse ( String query ) throws ParseException { } public Analyzer getAnalyzer ( ) { } public String getField ( ) { } public float getFuzzyMinSim ( ) { } public void setFuzzyMinSim ( float fuzzyMinSim ) { } public int getFuzzyPrefixLength ( ) { } public void setFuzzyPrefixLength ( int fuzzyPrefixLength ) { } public void setPhraseSlop ( int phraseSlop ) { } public int getPhraseSlop ( ) { } public void setAllowLeadingWildcard ( boolean allowLeadingWildcard ) { } public boolean getAllowLeadingWildcard ( ) { } public void setDefaultOperator ( QueryParser . Operator op ) { } public QueryParser . Operator getDefaultOperator ( ) { } public void setLowercaseExpandedTerms ( boolean lowercaseExpandedTerms ) { } public boolean getLowercaseExpandedTerms ( ) { } public void setUseOldRangeQuery ( boolean useOldRangeQuery ) { } public boolean getUseOldRangeQuery ( ) { } public void setLocale ( Locale locale ) { } public Locale getLocale ( ) { } public void setDateResolution ( DateTools . Resolution dateResolution ) { } public void setDateResolution ( String fieldName , DateTools . Resolution dateResolution ) { } public Resolution getDateResolution ( String fieldName ) { } protected void addClause ( Vector clauses , int conj , int mods , Query q ) { } protected Query getFieldQuery ( String field , String queryText ) throws ParseException { } protected Query getFieldQuery ( String field , String queryText , int slop ) throws ParseException { } protected Query getRangeQuery ( String field , String part1 , String part2 , boolean inclusive ) throws ParseException { } protected Query getBooleanQuery ( Vector clauses ) throws ParseException { } protected Query getBooleanQuery ( Vector clauses , boolean disableCoord ) throws ParseException { } protected Query getWildcardQuery ( String field , String termStr ) throws ParseException { } protected Query getPrefixQuery ( String field , String termStr ) throws ParseException { } protected Query getFuzzyQuery ( String field , String termStr , float minSimilarity ) throws ParseException { } private String discardEscapeChar ( String input ) throws ParseException { } private static final int hexToInt ( char c ) throws ParseException { } public static String escape ( String s ) { StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < ( s . length ( ) ) ; i ++ ) { char c = s . charAt ( i ) ; <START_BUG> if ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( c == '\\' ) || ( c == '+' ) ) || ( c == '-' ) ) || ( c == '!' ) ) || ( c == '(' ) ) || ( c == ')' ) ) || ( c == ':' ) ) || ( c == '^' ) ) || ( c == '[' ) ) || ( c == ']' ) ) || ( c == '\"' ) ) || ( c == '{' ) ) || ( c == '}' ) ) || ( c == '~' ) ) || ( c == '*' ) ) || ( c == '?' ) ) { <END_BUG> sb . append ( '\\' ) ; } sb . append ( c ) ; } return sb . toString ( ) ; } public static void main ( String [ ] args ) throws Exception { } public final int Conjunction ( ) throws ParseException { } public final int Modifiers ( ) throws ParseException { } public final Query TopLevelQuery ( String field ) throws ParseException { } public final Query Query ( String field ) throws ParseException { } public final Query Clause ( String field ) throws ParseException { } public final Query Term ( String field ) throws ParseException { } private final boolean jj_2_1 ( int xla ) { } private final boolean jj_3_1 ( ) { } private final boolean jj_3R_3 ( ) { } private final boolean jj_3R_2 ( ) { } public QueryParserTokenManager token_source ; public Token token ; public Token jj_nt ; private int jj_ntk ; private Token jj_scanpos ; private Token jj_lastpos ; private int jj_la ; public boolean lookingAhead = false ; private boolean jj_semLA ; private int jj_gen ; private final int [ ] jj_la1 = new int [ 23 ] ; private static int [ ] jj_la1_0 ; private static int [ ] jj_la1_1 ; private static void jj_la1_0 ( ) { } private static void jj_la1_1 ( ) { } private final QueryParser . JJCalls [ ] jj_2_rtns = new QueryParser . JJCalls [ 1 ] ; private boolean jj_rescan = false ; private int jj_gc = 0 ;

Fix:
if ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( c == '\\' ) || ( c == '+' ) ) || ( c == '-' ) ) || ( c == '!' ) ) || ( c == '(' ) ) || ( c == ')' ) ) || ( c == ':' ) ) || ( c == '^' ) ) || ( c == '[' ) ) || ( c == ']' ) ) || ( c == '\"' ) ) || ( c == '{' ) ) || ( c == '}' ) ) || ( c == '~' ) ) || ( c == '*' ) ) || ( c == '?' ) ) || ( c == '|' ) ) || ( c == '&' ) ) {