Buggy code:
public class ExtendedDismaxQParser extends QParser { private static String IMPOSSIBLE_FIELD_NAME = "￼￼￼" ; private static class U extends SolrPluginUtils { } private static interface DMP extends DisMaxParams { public static String UF = "uf" ; public static String LOWERCASE_OPS = "lowercaseOperators" ; public static String MULT_BOOST = "boost" ; public static String STOPWORDS = "stopwords" ; } private ExtendedDismaxQParser . ExtendedDismaxConfiguration config ; private Query parsedUserQuery ; private Query altUserQuery ; private List < Query > boostQueries ; public ExtendedDismaxQParser ( String qstr , SolrParams localParams , SolrParams params , SolrQueryRequest req ) { } @ Override public Query parse ( ) throws SyntaxError { } protected void addPhraseFieldQueries ( BooleanQuery query , List < ExtendedDismaxQParser . Clause > clauses , ExtendedDismaxQParser . ExtendedDismaxConfiguration config ) throws SyntaxError { } protected ExtendedDismaxQParser . ExtendedDismaxConfiguration createConfiguration ( String qstr , SolrParams localParams , SolrParams params , SolrQueryRequest req ) { } protected ExtendedDismaxQParser . ExtendedSolrQueryParser createEdismaxQueryParser ( QParser qParser , String field ) { } protected Query parseEscapedQuery ( ExtendedDismaxQParser . ExtendedSolrQueryParser up , String escapedUserQuery , ExtendedDismaxQParser . ExtendedDismaxConfiguration config ) throws SyntaxError { } protected Query parseOriginalQuery ( ExtendedDismaxQParser . ExtendedSolrQueryParser up , String mainUserQuery , List < ExtendedDismaxQParser . Clause > clauses , ExtendedDismaxQParser . ExtendedDismaxConfiguration config ) { } protected boolean shouldRemoveStopFilter ( ExtendedDismaxQParser . ExtendedDismaxConfiguration config , Query query ) { } private String escapeUserQuery ( List < ExtendedDismaxQParser . Clause > clauses ) { } private boolean doMinMatched ( List < ExtendedDismaxQParser . Clause > clauses , boolean lowercaseOperators ) { } protected String rebuildUserQuery ( List < ExtendedDismaxQParser . Clause > clauses , boolean lowercaseOperators ) { } protected List < ValueSource > getMultiplicativeBoosts ( ) throws SyntaxError { } protected List < Query > getBoostFunctions ( ) throws SyntaxError { } protected List < Query > getBoostQueries ( ) throws SyntaxError { } private void addAliasesFromRequest ( ExtendedDismaxQParser . ExtendedSolrQueryParser up , float tiebreaker ) { } protected void addShingledPhraseQueries ( final BooleanQuery mainQuery , final List < ExtendedDismaxQParser . Clause > clauses , final Map < String , Float > fields , int shingleSize , final float tiebreaker , final int slop ) throws SyntaxError { } @ Override public String [ ] getDefaultHighlightFields ( ) { } @ Override public Query getHighlightQuery ( ) throws SyntaxError { } @ Override public void addDebugInfo ( NamedList < Object > debugInfo ) { } protected static class Clause { boolean isBareWord ( ) { } protected String field ; protected String rawField ; protected boolean isPhrase ; protected boolean hasWhitespace ; protected boolean hasSpecialSyntax ; protected boolean syntaxError ; protected char must ; protected String val ; protected String raw ; } public List < ExtendedDismaxQParser . Clause > splitIntoClauses ( String s , boolean ignoreQuote ) { ArrayList < ExtendedDismaxQParser . Clause > lst = new ArrayList < ExtendedDismaxQParser . Clause > ( 4 ) ; ExtendedDismaxQParser . Clause clause ; int pos = 0 ; int end = s . length ( ) ; char ch = 0 ; int start ; boolean disallowUserField ; while ( pos < end ) { clause = new ExtendedDismaxQParser . Clause ( ) ; disallowUserField = true ; ch = s . charAt ( pos ) ; while ( Character . isWhitespace ( ch ) ) { if ( ( ++ pos ) >= end ) break ; ch = s . charAt ( pos ) ; } start = pos ; <START_BUG> if ( ( ch == '+' ) || ( ch == '-' ) ) { <END_BUG> clause . must = ch ; pos ++ ; } clause . field = getFieldName ( s , pos , end ) ; if ( ( ( clause . field ) != null ) && ( ! ( config . userFields . isAllowed ( clause . field ) ) ) ) { clause . field = null ; } if ( ( clause . field ) != null ) { disallowUserField = false ; int colon = s . indexOf ( ':' , pos ) ; clause . rawField = s . substring ( pos , colon ) ; pos += colon - pos ; pos ++ ; } if ( pos >= end ) break ; char inString = 0 ; ch = s . charAt ( pos ) ; if ( ( ! ignoreQuote ) && ( ch == '"' ) ) { clause . isPhrase = true ; inString = '"' ; pos ++ ; } StringBuilder sb = new StringBuilder ( ) ; while ( pos < end ) { ch = s . charAt ( ( pos ++ ) ) ; if ( ch == '\\' ) { sb . append ( ch ) ; if ( pos >= end ) { sb . append ( ch ) ; break ; } ch = s . charAt ( ( pos ++ ) ) ; sb . append ( ch ) ; continue ; } else if ( ( inString != 0 ) && ( ch == inString ) ) { inString = 0 ; break ; } else if ( Character . isWhitespace ( ch ) ) { clause . hasWhitespace = true ; if ( inString == 0 ) { pos -- ; break ; } } if ( inString == 0 ) { switch ( ch ) { case '!' : case '(' : case ')' : case ':' : case '^' : case '[' : case ']' : case '{' : case '}' : case '~' : case '*' : case '?' : case '"' : case '+' : case '-' : case '\\' : case '|' : case '&' : case '//' : clause . hasSpecialSyntax = true ; sb . append ( '\\' ) ; } } else if ( ch == '"' ) { sb . append ( '\\' ) ; } sb . append ( ch ) ; }

Fix:
if ( ( ( ch == '+' ) || ( ch == '-' ) ) && ( ( pos + 1 ) < end ) ) {