Buggy code:
} if ( ( ( ( fGrammar ) != null ) && ( fGrammarIsSchemaGrammar ) ) && ( elementIndex != ( - 1 ) ) ) { fAttrListHandle = addDefaultAttributes ( elementIndex , attrList , fAttrListHandle , fValidating , ( ( fStandaloneReader ) != ( - 1 ) ) ) ; } if ( ( fAttrListHandle ) != ( - 1 ) ) { fAttrList . endAttrList ( ) ; } if ( XMLValidator . DEBUG_PRINT_ATTRIBUTES ) { String elementStr = fStringPool . toString ( element . rawname ) ; System . out . print ( ( "startElement:<seq2seq4repair_space><" + elementStr ) ) ; if ( ( fAttrListHandle ) != ( - 1 ) ) { int index = attrList . getFirstAttr ( fAttrListHandle ) ; while ( index != ( - 1 ) ) { System . out . print ( ( ( ( ( "<seq2seq4repair_space>" + ( fStringPool . toString ( attrList . getAttrName ( index ) ) ) ) + "=\"" ) + ( fStringPool . toString ( attrList . getAttValue ( index ) ) ) ) + "\"" ) ) ; index = attrList . getNextAttr ( index ) ; } } System . out . println ( ">" ) ; } if ( ( ( fAttrListHandle ) != ( - 1 ) ) && ( ! ( fNeedValidationOff ) ) ) { int index = fAttrList . getFirstAttr ( fAttrListHandle ) ; while ( index != ( - 1 ) ) { int attrNameIndex = attrList . getAttrName ( index ) ; if ( fStringPool . equalNames ( attrNameIndex , fXMLLang ) ) { fDocumentScanner . checkXMLLangAttributeValue ( attrList . getAttValue ( index ) ) ; } int _xmlns = fStringPool . addSymbol ( "xmlns" ) ; if ( ( attrNameIndex != _xmlns ) && ( ( attrList . getAttrPrefix ( index ) ) != _xmlns ) ) if ( ( fGrammar ) != null ) { fTempQName . setValues ( attrList . getAttrPrefix ( index ) , attrList . getAttrLocalpart ( index ) , attrList . getAttrName ( index ) , attrList . getAttrURI ( index ) ) ; int attDefIndex = getAttDefByElementIndex ( elementIndex , fTempQName ) ; if ( ( fTempQName . uri ) != ( fXsiURI ) ) if ( attDefIndex == ( - 1 ) ) { if ( fValidating ) { Object [ ] args = new Object [ ] { fStringPool . toString ( element . rawname ) , fStringPool . toString ( attrList . getAttrName ( index ) ) } ; fAttrNameLocator = getLocatorImpl ( fAttrNameLocator ) ; fErrorReporter . reportError ( fAttrNameLocator , XML_DOMAIN , MSG_ATTRIBUTE_NOT_DECLARED , VC_ATTRIBUTE_VALUE_TYPE , args , ERRORTYPE_RECOVERABLE_ERROR ) ; } } else { fGrammar . getAttributeDecl ( attDefIndex , fTempAttDecl ) ; int attributeType = attributeTypeName ( fTempAttDecl ) ; attrList . setAttType ( index , attributeType ) ; if ( fValidating ) { if ( fGrammarIsDTDGrammar ) { int normalizedValue = validateDTDattribute ( element , attrList . getAttValue ( index ) , fTempAttDecl ) ; attrList . setAttValue ( index , normalizedValue ) ; } else if ( ( fGrammarIsSchemaGrammar ) && ( ( ( ( ( fTempAttDecl . type ) == ( XMLAttributeDecl . TYPE_ANY_ANY ) ) || ( ( fTempAttDecl . type ) == ( XMLAttributeDecl . TYPE_ANY_LIST ) ) ) || ( ( fTempAttDecl . type ) == ( XMLAttributeDecl . TYPE_ANY_LOCAL ) ) ) || ( ( fTempAttDecl . type ) == ( XMLAttributeDecl . TYPE_ANY_OTHER ) ) ) ) { if ( ( fTempAttDecl . defaultType ) == ( XMLAttributeDecl . PROCESSCONTENTS_SKIP ) ) { } else if ( ( ( fTempAttDecl . defaultType ) == ( XMLAttributeDecl . PROCESSCONTENTS_STRICT ) ) || ( ( fTempAttDecl . defaultType ) == ( XMLAttributeDecl . PROCESSCONTENTS_LAX ) ) ) { boolean reportError = false ; boolean processContentStrict = ( fTempAttDecl . defaultType ) == ( XMLAttributeDecl . PROCESSCONTENTS_STRICT ) ; if ( ( fTempQName . uri ) == ( StringPool . EMPTY_STRING ) ) { if ( processContentStrict ) { reportError = true ; } } else { Grammar aGrammar = fGrammarResolver . getGrammar ( fStringPool . toString ( fTempQName . uri ) ) ; if ( ( aGrammar == null ) || ( ! ( aGrammar instanceof SchemaGrammar ) ) ) { if ( processContentStrict ) { reportError = true ; } } else { SchemaGrammar sGrammar = ( ( SchemaGrammar ) ( aGrammar ) ) ; <START_BUG> Hashtable attRegistry = sGrammar . getAttirubteDeclRegistry ( ) ; <END_BUG> if ( attRegistry == null ) { if ( processContentStrict ) { reportError = true ; } } else { XMLAttributeDecl attDecl = ( ( XMLAttributeDecl ) ( attRegistry . get ( fStringPool . toString ( fTempQName . localpart ) ) ) ) ; if ( attDecl == null ) { if ( processContentStrict ) { reportError = true ; } } else { DatatypeValidator attDV = attDecl . datatypeValidator ; if ( attDV == null ) { if ( processContentStrict ) { reportError = true ; } } else { try { String unTrimValue = fStringPool . toString ( attrList . getAttValue ( index ) ) ; String value = unTrimValue . trim ( ) ; if ( ( attDecl . type ) == ( XMLAttributeDecl . TYPE_ID ) ) { this . fStoreIDRef . setDatatypeObject ( fValID . validate ( value , null ) ) ; } if ( ( attDecl . type ) == ( XMLAttributeDecl . TYPE_IDREF ) ) { attDV . validate ( value , this . fStoreIDRef ) ; } else { fWhiteSpace = attDV . getWSFacet ( ) ; if ( ( fWhiteSpace ) == ( DatatypeValidator . REPLACE ) ) { attDV . validate ( unTrimValue , null ) ; } else { int normalizedValue = fStringPool . addString ( value ) ; attrList . setAttValue ( index , normalizedValue ) ;

Fix:
Hashtable attRegistry = sGrammar . getAttributeDeclRegistry ( ) ;