Buggy code:
private XSDocumentInfo fRoot = null ; private Hashtable fDoc2XSDocumentMap = new Hashtable ( ) ; private Hashtable fRedefine2XSDMap = new Hashtable ( ) ; private Hashtable fRedefine2NSSupport = new Hashtable ( ) ; private Hashtable fRedefinedRestrictedAttributeGroupRegistry = new Hashtable ( ) ; private Hashtable fRedefinedRestrictedGroupRegistry = new Hashtable ( ) ; private boolean fLastSchemaWasDuplicate ; private XMLErrorReporter fErrorReporter ; private XMLEntityResolver fEntityResolver ; private XSAttributeChecker fAttributeChecker ; private SymbolTable fSymbolTable ; private XSGrammarBucket fGrammarBucket ; private XSDDescription fSchemaGrammarDescription ; private XMLGrammarPool fGrammarPool ; XSDAttributeGroupTraverser fAttributeGroupTraverser ; XSDAttributeTraverser fAttributeTraverser ; XSDComplexTypeTraverser fComplexTypeTraverser ; XSDElementTraverser fElementTraverser ; XSDGroupTraverser fGroupTraverser ; XSDKeyrefTraverser fKeyrefTraverser ; XSDNotationTraverser fNotationTraverser ; XSDSimpleTypeTraverser fSimpleTypeTraverser ; XSDUniqueOrKeyTraverser fUniqueOrKeyTraverser ; XSDWildcardTraverser fWildCardTraverser ; DOMParser fSchemaParser ; final DOMNodePool fDOMPool = new DOMNodePool ( ) ; private static final int INIT_STACK_SIZE = 30 ; private static final int INC_STACK_SIZE = 10 ; private int fLocalElemStackPos = 0 ; private XSParticleDecl [ ] fParticle = new XSParticleDecl [ XSDHandler . INIT_STACK_SIZE ] ; private Element [ ] fLocalElementDecl = new Element [ XSDHandler . INIT_STACK_SIZE ] ; private int [ ] fAllContext = new int [ XSDHandler . INIT_STACK_SIZE ] ; private XSComplexTypeDecl [ ] fEnclosingCT = new XSComplexTypeDecl [ XSDHandler . INIT_STACK_SIZE ] ; private String [ ] [ ] fLocalElemNamespaceContext = new String [ XSDHandler . INIT_STACK_SIZE ] [ 1 ] ; private static final int INIT_KEYREF_STACK = 2 ; private static final int INC_KEYREF_STACK_AMOUNT = 2 ; private int fKeyrefStackPos = 0 ; private Element [ ] fKeyrefs = new Element [ XSDHandler . INIT_KEYREF_STACK ] ; private XSElementDecl [ ] fKeyrefElems = new XSElementDecl [ XSDHandler . INIT_KEYREF_STACK ] ; private String [ ] [ ] fKeyrefNamespaceContext = new String [ XSDHandler . INIT_KEYREF_STACK ] [ 1 ] ; public XSDHandler ( XSGrammarBucket gBucket ) { } public SchemaGrammar parseSchema ( XMLInputSource is , XSDDescription desc , Hashtable locationPairs ) { } protected SchemaGrammar findGrammar ( XSDDescription desc ) { } private static final String [ ] [ ] NS_ERROR_CODES = new String [ ] [ ] { new String [ ] { "src-include.2.1" , "src-include.2.1" } , new String [ ] { "src-redefine.3.1" , "src-redefine.3.1" } , new String [ ] { "src-import.3.1" , "src-import.3.2" } , null , new String [ ] { "TargetNamespace.1" , "TargetNamespace.2" } , new String [ ] { "TargetNamespace.1" , "TargetNamespace.2" } , new String [ ] { "TargetNamespace.1" , "TargetNamespace.2" } , new String [ ] { "TargetNamespace.1" , "TargetNamespace.2" } } ; private static final String [ ] ELE_ERROR_CODES = new String [ ] { "src-include.1" , "src-redefine.2" , "src-import.2" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" } ; protected XSDocumentInfo constructTrees ( Document schemaRoot , String locationHint , XSDDescription desc ) { } protected void buildGlobalNameRegistries ( ) { } protected void traverseSchemas ( ) { } private Vector fReportedTNS = null ; private final boolean needReportTNSError ( String uri ) { } private static final String [ ] COMP_TYPE = new String [ ] { null , "attribute<seq2seq4repair_space>declaration" , "attribute<seq2seq4repair_space>group" , "elment<seq2seq4repair_space>declaration" , "group" , "identity<seq2seq4repair_space>constraint" , "notation" , "type<seq2seq4repair_space>definition" } ; protected Object getGlobalDecl ( XSDocumentInfo currSchema , int declType , QName declToTraverse , Element elmNode ) { } Object getGrpOrAttrGrpRedefinedByRestriction ( int type , QName name , XSDocumentInfo currSchema , Element elmNode ) { } protected void resolveKeyRefs ( ) { } protected Hashtable getIDRegistry ( ) { } protected void storeKeyRef ( Element keyrefToStore , XSDocumentInfo schemaDoc , XSElementDecl currElemDecl ) { } private static final String [ ] DOC_ERROR_CODES = new String [ ] { "src-include.0" , "src-redefine.0" , "src-import.0" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" , "schema_reference.4" } ; private Document getSchema ( XSDDescription desc , boolean mustResolve , Element referElement ) { } private Document getSchema ( String schemaNamespace , XMLInputSource schemaSource , boolean mustResolve , short referType , Element referElement ) { } private void createTraversers ( ) { } void prepareForParse ( ) { } void prepareForTraverse ( ) { } public void setDeclPool ( XSDeclarationPool declPool ) { } public void reset ( XMLErrorReporter errorReporter , XMLEntityResolver entityResolver , SymbolTable symbolTable , XMLGrammarPool grammarPool ) { } void resetSchemaParserErrorHandler ( ) { try { if ( ( fSchemaParser ) != null ) { XMLErrorHandler currErrorHandler = fErrorReporter . getErrorHandler ( ) ; <START_BUG> if ( currErrorHandler == ( fSchemaParser . getProperty ( XSDHandler . ERROR_HANDLER ) ) ) { <END_BUG> fSchemaParser . setProperty ( XSDHandler . ERROR_HANDLER , currErrorHandler ) ; } } } catch ( Exception e ) { } } void traverseLocalElements ( ) { } void fillInLocalElemInfo ( Element elmDecl , XSDocumentInfo schemaDoc , int allContextFlags , XSComplexTypeDecl enclosingCT , XSParticleDecl particle ) { } void checkForDuplicateNames ( String qName , Hashtable registry , Element currComp , XSDocumentInfo currSchema ) { } private void renameRedefiningComponents ( XSDocumentInfo currSchema , Element child , String componentType , String oldName , String newName ) { } private String findQName ( String name , XSDocumentInfo schemaDoc ) { } private int changeRedefineGroup ( String originalQName , String elementSought , String newName , Element curr , XSDocumentInfo schemaDoc ) { } private XSDocumentInfo findXSDocumentForDecl ( XSDocumentInfo currSchema , Element decl ) { } private boolean nonAnnotationContent ( Element elem ) { } private void setSchemasVisible ( XSDocumentInfo startSchema ) { } private SimpleLocator xl = new SimpleLocator ( ) ; public SimpleLocator element2Locator ( Element e ) { } public boolean element2Locator ( Element e , SimpleLocator l ) { } void reportSchemaError ( String key , Object [ ] args , Element ele ) { } void reportSchemaWarning ( String key , Object [ ] args , Element ele ) { } private static class XSDKey { String systemId ; short referType ; String referNS ; XSDKey ( String systemId , short referType , String referNS ) { } public int hashCode ( ) { } public boolean equals ( Object obj ) { } } }

Fix:
if ( currErrorHandler != ( fSchemaParser . getProperty ( XSDHandler . ERROR_HANDLER ) ) ) {