Buggy code:
private int [ ] fAllContext = new int [ XSDHandler . INIT_STACK_SIZE ] ; private XSObject [ ] fParent = new XSObject [ 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 ( ) { } public XSDHandler ( XSGrammarBucket gBucket ) { } public SchemaGrammar parseSchema ( XMLInputSource is , XSDDescription desc , Hashtable locationPairs ) throws IOException { } private void validateAnnotations ( ArrayList annotationInfo ) { } private void createAnnotationValidator ( ) { } SchemaGrammar getGrammar ( String tns ) { } 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 ) { } private boolean isExistingGrammar ( XSDDescription desc ) { } protected void buildGlobalNameRegistries ( ) { } protected void traverseSchemas ( ArrayList annotationInfo ) { } 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" , "element<seq2seq4repair_space>declaration" , "group" , "identity<seq2seq4repair_space>constraint" , "notation" , "type<seq2seq4repair_space>definition" } ; private static final String [ ] CIRCULAR_CODES = new String [ ] { "Internal-Error" , "Internal-Error" , "src-attribute_group.3" , "e-props-correct.6" , "mg-props-correct.2" , "Internal-Error" , "Internal-Error" , "st-props-correct.2" } ; 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 Document resolveSchema ( XSDDescription desc , boolean mustResolve , Element referElement ) { } private Document getSchemaDocument ( 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 ( XMLComponentManager componentManager ) { } void traverseLocalElements ( ) { fElementTraverser . fDeferTraversingLocalElements = false ; for ( int i = 0 ; i < ( fLocalElemStackPos ) ; i ++ ) { Element currElem = fLocalElementDecl [ i ] ; XSDocumentInfo currSchema = ( ( XSDocumentInfo ) ( fDoc2XSDocumentMap . get ( DOMUtil . getDocument ( currElem ) ) ) ) ; SchemaGrammar currGrammar = fGrammarBucket . getGrammar ( currSchema . fTargetNamespace ) ; <START_BUG> fElementTraverser . traverseLocal ( fParticle [ i ] , currElem , currSchema , currGrammar , fAllContext [ i ] , fParent [ i ] ) ; <END_BUG> if ( ( fParticle [ i ] . fType ) == ( XSParticleDecl . PARTICLE_EMPTY ) ) { XSModelGroupImpl group = null ; if ( ( fParent [ i ] ) instanceof XSComplexTypeDecl ) { XSParticle p = ( ( XSComplexTypeDecl ) ( fParent [ i ] ) ) . getParticle ( ) ; if ( p != null ) group = ( ( XSModelGroupImpl ) ( p . getTerm ( ) ) ) ; } else { group = ( ( XSGroupDecl ) ( fParent [ i ] ) ) . fModelGroup ; } if ( group != null ) removeParticle ( group , fParticle [ i ] ) ; } } } private boolean removeParticle ( XSModelGroupImpl group , XSParticleDecl particle ) { } void fillInLocalElemInfo ( Element elmDecl , XSDocumentInfo schemaDoc , int allContextFlags , XSObject parent , 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 XSAnnotationGrammarPool implements XMLGrammarPool { private XSGrammarBucket fGrammarBucket ; private Grammar [ ] fInitialGrammarSet ; public Grammar [ ] retrieveInitialGrammarSet ( String grammarType ) { }

Fix:
fElementTraverser . traverseLocal ( fParticle [ i ] , currElem , currSchema , currGrammar , fAllContext [ i ] , fParent [ i ] , fLocalElemNamespaceContext [ i ] ) ;