Buggy code:
protected Hashtable fNotationRegistry = new Hashtable ( ) ; protected XSDeclarationPool fDeclPool = null ; private Hashtable fUnparsedAttributeRegistry = new Hashtable ( ) ; private Hashtable fUnparsedAttributeGroupRegistry = new Hashtable ( ) ; private Hashtable fUnparsedElementRegistry = new Hashtable ( ) ; private Hashtable fUnparsedGroupRegistry = new Hashtable ( ) ; private Hashtable fUnparsedIdentityConstraintRegistry = new Hashtable ( ) ; private Hashtable fUnparsedNotationRegistry = new Hashtable ( ) ; private Hashtable fUnparsedTypeRegistry = new Hashtable ( ) ; private Hashtable fXSDocumentInfoRegistry = new Hashtable ( ) ; private Hashtable fDependencyMap = new Hashtable ( ) ; private Hashtable fImportMap = new Hashtable ( ) ; private Vector fAllTNSs = new Vector ( ) ; private Hashtable fLocationPairs = null ; private String null2EmptyString ( String ns ) { } private String emptyString2Null ( String ns ) { } private Hashtable fTraversed = new Hashtable ( ) ; private Hashtable fDoc2SystemId = new Hashtable ( ) ; 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 ) { fLocationPairs = locationPairs ; SchemaGrammar grammar = findGrammar ( desc ) ; if ( grammar != null ) return grammar ; fDOMPool . reset ( ) ; if ( ( fSchemaParser ) != null ) { fSchemaParser . setPool ( fDOMPool ) ; } short referType = desc . getContextType ( ) ; String schemaNamespace = desc . getTargetNamespace ( ) ; if ( schemaNamespace != null ) { schemaNamespace = fSymbolTable . addSymbol ( schemaNamespace ) ; } prepareForParse ( ) ; Document schemaRoot = getSchema ( schemaNamespace , is , ( referType == ( XSDDescription . CONTEXT_PREPARSE ) ) , referType , null ) ; if ( schemaRoot == null ) { return null ; } if ( ( schemaNamespace == null ) && ( referType == ( XSDDescription . CONTEXT_PREPARSE ) ) ) { Element schemaElem = DOMUtil . getRoot ( schemaRoot ) ; schemaNamespace = DOMUtil . getAttrValue ( schemaElem , ATT_TARGETNAMESPACE ) ; if ( ( schemaNamespace != null ) && ( ( schemaNamespace . length ( ) ) > 0 ) ) { <START_BUG> fSymbolTable . addSymbol ( schemaNamespace ) ; <END_BUG> desc . setTargetNamespace ( schemaNamespace ) ; String schemaId = XMLEntityManager . expandSystemId ( desc . getLiteralSystemId ( ) , desc . getBaseSystemId ( ) ) ; XSDHandler . XSDKey key = new XSDHandler . XSDKey ( schemaId , referType , schemaNamespace ) ; fTraversed . put ( key , schemaRoot ) ; if ( schemaId != null ) { fDoc2SystemId . put ( schemaRoot , schemaId ) ; } } } prepareForTraverse ( ) ; fRoot = constructTrees ( schemaRoot , is . getSystemId ( ) , desc ) ; if ( ( fRoot ) == null ) { return null ; } buildGlobalNameRegistries ( ) ; traverseSchemas ( ) ; traverseLocalElements ( ) ; resolveKeyRefs ( ) ; for ( int i = ( fAllTNSs . size ( ) ) - 1 ; i >= 0 ; i -- ) { String tns = ( ( String ) ( fAllTNSs . elementAt ( i ) ) ) ; Vector ins = ( ( Vector ) ( fImportMap . get ( tns ) ) ) ; SchemaGrammar sg = fGrammarBucket . getGrammar ( emptyString2Null ( tns ) ) ; if ( sg == null ) continue ; SchemaGrammar isg ; int count = 0 ; for ( int j = 0 ; j < ( ins . size ( ) ) ; j ++ ) { isg = fGrammarBucket . getGrammar ( ( ( String ) ( ins . elementAt ( j ) ) ) ) ; if ( isg != null ) ins . setElementAt ( isg , ( count ++ ) ) ; } ins . setSize ( count ) ; sg . setImportedGrammars ( ins ) ; } return fGrammarBucket . getGrammar ( fRoot . fTargetNamespace ) ; } 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" }

Fix:
schemaNamespace = fSymbolTable . addSymbol ( schemaNamespace ) ;