Buggy code:
final class UCSReader extends XMLEntityReader implements StringPool . StringProducer { private static final boolean DEBUG_UTF16_BIG = false ; static final int E_UCS4B = 0 ; static final int E_UCS4L = 1 ; static final int E_UCS2B = 2 ; static final int E_UCS2L = 3 ; static final int E_UCS2B_NOBOM = 4 ; static final int E_UCS2L_NOBOM = 5 ; private ChunkyByteArray fData = null ; private int fEncoding = - 1 ; private StringPool fStringPool = null ; private int fBytesPerChar = - 1 ; private boolean fBigEndian = true ; private ChunkyCharArray fStringCharArray = null ; private boolean fCalledCharPropInit = false ; UCSReader ( XMLEntityHandler entityHandler , XMLErrorReporter errorReporter , boolean sendCharDataAsCharArray , ChunkyByteArray data , int encoding , StringPool stringPool ) throws Exception { } private int getChar ( int offset ) throws IOException { } public int addString ( int offset , int length ) { } public int addSymbol ( int offset , int length ) { } public void append ( XMLEntityHandler . CharBuffer charBuffer , int offset , int length ) { } public void releaseString ( int offset , int length ) { } public String toString ( int offset , int length ) { } private int getHashcode ( int offset , int length ) { } public boolean equalsString ( int offset , int length , char [ ] strChars , int strOffset , int strLength ) { } private static char [ ] fCharacters = new char [ 256 ] ; private int fCharDataLength = 0 ; private void appendCharData ( int ch ) { } public void callCharDataHandler ( int offset , int length , boolean isWhitespace ) throws Exception { } public boolean lookingAtChar ( char ch , 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 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 nameOffset = fCurrentOffset ; int ch ; int prefixend = - 1 ; int offset = fCurrentOffset ; ch = getChar ( fCurrentOffset ) ; if ( ch < 128 ) { if ( ( XMLCharacterProperties . fgAsciiInitialNameChar [ ch ] ) == 0 ) { qname . clear ( ) ; return ; } if ( ch == ':' ) { qname . clear ( ) ; return ; } } else { if ( ! ( fCalledCharPropInit ) ) { XMLCharacterProperties . initCharFlags ( ) ; fCalledCharPropInit = true ; } if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_InitialNameCharFlag ) ) == 0 ) return ; } while ( true ) { fCurrentOffset += fBytesPerChar ; ( fCharacterCounter ) ++ ; ch = getChar ( fCurrentOffset ) ; if ( fastcheck == ch ) { break ; } if ( ch < 128 ) { if ( ( XMLCharacterProperties . fgAsciiNameChar [ ch ] ) == 0 ) { break ; } if ( ch == ':' ) { if ( prefixend != ( - 1 ) ) { break ; } prefixend = fCurrentOffset ; ch = getChar ( ( ( fCurrentOffset ) + ( fBytesPerChar ) ) ) ; boolean lpok = true ; if ( ch < 128 ) { if ( ( ( XMLCharacterProperties . fgAsciiInitialNameChar [ ch ] ) == 0 ) || ( ch == ':' ) ) { lpok = false ; } } else { if ( ! ( fCalledCharPropInit ) ) { XMLCharacterProperties . initCharFlags ( ) ; fCalledCharPropInit = true ; } if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_InitialNameCharFlag ) ) == 0 ) { lpok = false ; } } if ( ! lpok ) { prefixend = - 1 ; break ; } } } else { if ( ! ( fCalledCharPropInit ) ) { XMLCharacterProperties . initCharFlags ( ) ; fCalledCharPropInit = true ; } <START_BUG> if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_InitialNameCharFlag ) ) == 0 ) { <END_BUG> break ; } } } int length = ( fCurrentOffset ) - offset ; qname . prefix = ( prefixend == ( - 1 ) ) ? - 1 : addSymbol ( offset , ( prefixend - offset ) ) ; qname . rawname = addSymbol ( offset , length ) ; qname . localpart = ( prefixend == ( - 1 ) ) ? qname . rawname : addSymbol ( ( prefixend + ( fBytesPerChar ) ) , ( ( fCurrentOffset ) - ( prefixend + ( fBytesPerChar ) ) ) ) ; qname . uri = StringPool . EMPTY_STRING ; } public int scanName ( char fastcheck ) throws Exception { } private static final char [ ] cdata_string = new char [ ] { 'C' , 'D' , 'A' , 'T' , 'A' , '[' } ; private int recognizeMarkup ( ) throws Exception { } private int recognizeReference ( ) throws Exception { } public int scanContent ( QName element ) throws Exception { } }

Fix:
if ( ( ( XMLCharacterProperties . fgCharFlags [ ch ] ) & ( XMLCharacterProperties . E_NameCharFlag ) ) == 0 ) {