Buggy code:
public class XMLGrammarBuilder { public static final String SYMBOL_TABLE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SYMBOL_TABLE_PROPERTY ) ; public static final String GRAMMAR_POOL = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . XMLGRAMMAR_POOL_PROPERTY ) ; protected static final String NAMESPACES_FEATURE_ID = "http:////xml.org//sax//features//namespaces" ; protected static final String VALIDATION_FEATURE_ID = "http:////xml.org//sax//features//validation" ; protected static final String SCHEMA_VALIDATION_FEATURE_ID = "http:////apache.org//xml//features//validation//schema" ; protected static final String SCHEMA_FULL_CHECKING_FEATURE_ID = "http:////apache.org//xml//features//validation//schema-full-checking" ; protected static final String HONOUR_ALL_SCHEMA_LOCATIONS_ID = "http:////apache.org//xml//features//honour-all-schemaLocations" ; public static final int BIG_PRIME = 2039 ; protected static final boolean DEFAULT_SCHEMA_FULL_CHECKING = false ; protected static final boolean DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS = false ; public static void main ( String [ ] argv ) { if ( ( argv . length ) < 2 ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } XMLParserConfiguration parserConfiguration = null ; String arg = null ; int i = 0 ; arg = argv [ i ] ; if ( arg . equals ( "-p" ) ) { i ++ ; String parserName = argv [ i ] ; try { ClassLoader cl = ObjectFactory . findClassLoader ( ) ; parserConfiguration = ( ( XMLParserConfiguration ) ( ObjectFactory . newInstance ( parserName , cl , true ) ) ) ; } catch ( Exception e ) { parserConfiguration = null ; System . err . println ( ( ( "error:<seq2seq4repair_space>Unable<seq2seq4repair_space>to<seq2seq4repair_space>instantiate<seq2seq4repair_space>parser<seq2seq4repair_space>configuration<seq2seq4repair_space>(" + parserName ) + ")" ) ) ; } i ++ ; } arg = argv [ i ] ; Vector externalDTDs = null ; if ( arg . equals ( "-d" ) ) { externalDTDs = new Vector ( ) ; i ++ ; while ( ( i < ( argv . length ) ) && ( ! ( ( arg = argv [ i ] ) . startsWith ( "-" ) ) ) ) { externalDTDs . addElement ( arg ) ; i ++ ; } if ( ( externalDTDs . size ( ) ) == 0 ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } } Vector schemas = null ; boolean schemaFullChecking = XMLGrammarBuilder . DEFAULT_SCHEMA_FULL_CHECKING ; boolean honourAllSchemaLocations = XMLGrammarBuilder . DEFAULT_HONOUR_ALL_SCHEMA_LOCATIONS ; if ( i < ( argv . length ) ) { arg = argv [ i ] ; if ( arg . equals ( "-f" ) ) { schemaFullChecking = true ; i ++ ; arg = argv [ i ] ; } else if ( arg . equals ( "-F" ) ) { schemaFullChecking = false ; i ++ ; arg = argv [ i ] ; <START_BUG> } else <END_BUG> if ( arg . equals ( "-hs" ) ) { honourAllSchemaLocations = true ; i ++ ; arg = argv [ i ] ; } else if ( arg . equals ( "-HS" ) ) { honourAllSchemaLocations = false ; i ++ ; arg = argv [ i ] ; } if ( arg . equals ( "-a" ) ) { if ( externalDTDs != null ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } schemas = new Vector ( ) ; i ++ ; while ( ( i < ( argv . length ) ) && ( ! ( ( arg = argv [ i ] ) . startsWith ( "-" ) ) ) ) { schemas . addElement ( arg ) ; i ++ ; } if ( ( schemas . size ( ) ) == 0 ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } } } Vector ifiles = null ; if ( i < ( argv . length ) ) { if ( ! ( arg . equals ( "-i" ) ) ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } i ++ ; ifiles = new Vector ( ) ; while ( ( i < ( argv . length ) ) && ( ! ( ( arg = argv [ i ] ) . startsWith ( "-" ) ) ) ) { ifiles . addElement ( arg ) ; i ++ ; } if ( ( ( ifiles . size ( ) ) == 0 ) || ( i != ( argv . length ) ) ) { XMLGrammarBuilder . printUsage ( ) ; System . exit ( 1 ) ; } } SymbolTable sym = new SymbolTable ( XMLGrammarBuilder . BIG_PRIME ) ; XMLGrammarPreparser preparser = new XMLGrammarPreparser ( sym ) ; XMLGrammarPoolImpl grammarPool = new XMLGrammarPoolImpl ( ) ; boolean isDTD = false ; if ( externalDTDs != null ) { preparser . registerPreparser ( XML_DTD , null ) ; isDTD = true ; } else if ( schemas != null ) { preparser . registerPreparser ( XML_SCHEMA , null ) ; isDTD = false ; } else { System . err . println ( "No<seq2seq4repair_space>schema<seq2seq4repair_space>or<seq2seq4repair_space>DTD<seq2seq4repair_space>specified!" ) ; System . exit ( 1 ) ; } preparser . setProperty ( XMLGrammarBuilder . GRAMMAR_POOL , grammarPool ) ; preparser . setFeature ( XMLGrammarBuilder . NAMESPACES_FEATURE_ID , true ) ; preparser . setFeature ( XMLGrammarBuilder . VALIDATION_FEATURE_ID , true ) ; preparser . setFeature ( XMLGrammarBuilder . SCHEMA_VALIDATION_FEATURE_ID , true ) ; preparser . setFeature ( XMLGrammarBuilder . SCHEMA_FULL_CHECKING_FEATURE_ID , schemaFullChecking ) ; preparser . setFeature ( XMLGrammarBuilder . HONOUR_ALL_SCHEMA_LOCATIONS_ID , honourAllSchemaLocations ) ; try { if ( isDTD ) { for ( i = 0 ; i < ( externalDTDs . size ( ) ) ; i ++ ) { Grammar g = preparser . preparseGrammar ( XML_DTD , XMLGrammarBuilder . stringToXIS ( ( ( String ) ( externalDTDs . elementAt ( i ) ) ) ) ) ; } } else { for ( i = 0 ; i < ( schemas . size ( ) ) ;

Fix:
}