Buggy code:
private StringReader ( XMLEntityHandler entityHandler , XMLErrorReporter errorReporter , boolean sendCharDataAsCharArray , int lineNumber , int columnNumber , int stringHandle , StringPool stringPool , boolean addEnclosingSpaces ) { } private void init ( XMLEntityHandler entityHandler , XMLErrorReporter errorReporter , boolean sendCharDataAsCharArray , int lineNumber , int columnNumber , int stringHandle , StringPool stringPool , boolean addEnclosingSpaces ) { } public int addString ( int offset , int length ) { } public int addSymbol ( int offset , int length ) { } public void append ( XMLEntityHandler . CharBuffer charBuffer , int offset , int length ) { } private int loadNextChar ( ) { } public EntityReader changeReaders ( ) throws Exception { } public boolean lookingAtChar ( char chr , boolean skipPastChar ) throws Exception { } public boolean lookingAtValidChar ( boolean skipPastChar ) throws Exception { } public boolean lookingAtSpace ( boolean skipPastChar ) throws Exception { } public void skipToChar ( char chr ) throws Exception { } public void skipPastSpaces ( ) throws Exception { } public void skipPastName ( char fastcheck ) throws Exception { } public void skipPastNmtoken ( char fastcheck ) throws Exception { } public boolean skippedString ( char [ ] s ) throws Exception { } public int scanInvalidChar ( ) throws Exception { } public int scanCharRef ( boolean hex ) throws Exception { } public int scanStringLiteral ( ) throws Exception { } public int scanAttValue ( char qchar , boolean asSymbol ) throws Exception { } public static final byte [ ] fgAsciiEntityValueChar = new byte [ ] { 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 0 , 0 , 4 , 4 , 0 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 4 , 0 , 0 , 1 , 0 , 0 , 3 , 2 , 1 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ; public int scanEntityValue ( int qchar , boolean createString ) throws Exception { } public boolean scanExpectedName ( char fastcheck , StringPool . CharArrayRange expectedName ) throws Exception { } public void scanQName ( char fastcheck , QName qname ) throws Exception { int ch = fMostRecentChar ; if ( ch == ( - 1 ) ) { changeReaders ( ) . scanQName ( fastcheck , qname ) ; return ; } if ( ! ( fCalledCharPropInit ) ) { XMLCharacterProperties . initCharFlags ( ) ; fCalledCharPropInit = true ; } int nameOffset = fCurrentOffset ; if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_InitialNameCharFlag ) ) == 0 ) { qname . clear ( ) ; return ; } while ( true ) { ch = loadNextChar ( ) ; if ( fastcheck == ch ) break ; if ( ch == ( - 1 ) ) break ; if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_NameCharFlag ) ) == 0 ) break ; } qname . clear ( ) ; qname . rawname = fStringPool . addSymbol ( fData . substring ( nameOffset , fCurrentOffset ) ) ; int index = fData . indexOf ( ':' , nameOffset ) ; <START_BUG> if ( index != ( - 1 ) ) { <END_BUG> qname . prefix = fStringPool . addSymbol ( fData . substring ( nameOffset , index ) ) ; int indexOfSpaceChar = fData . indexOf ( '<seq2seq4repair_space>' , ( index + 1 ) ) ; String localPart ; if ( indexOfSpaceChar != ( - 1 ) ) { localPart = fData . substring ( ( index + 1 ) , indexOfSpaceChar ) ; qname . localpart = fStringPool . addSymbol ( localPart ) ; } else { int lenfData = fData . length ( ) ; localPart = fData . substring ( ( index + 1 ) , lenfData ) ; qname . localpart = fStringPool . addSymbol ( localPart ) ; } qname . localpart = fStringPool . addSymbol ( localPart ) ; } else { qname . localpart = qname . rawname ; } } public int scanName ( char fastcheck ) throws Exception { } private int recognizeMarkup ( int ch ) throws Exception { } private int recognizeReference ( int ch ) throws Exception { } public int scanContent ( QName element ) throws Exception { } private void callCharDataHandler ( int offset , int endOffset , boolean isWhitespace ) throws Exception { } private static final char [ ] cdata_string = new char [ ] { 'C' , 'D' , 'A' , 'T' , 'A' , '[' }

Fix:
if ( ( index != ( - 1 ) ) && ( index < ( fCurrentOffset ) ) ) {