Buggy code:
public boolean characterData ( String data , Augmentations augs ) { } public void elementDefault ( String data ) { } public void startGeneralEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void textDecl ( String version , String encoding , Augmentations augs ) throws XNIException { } public void comment ( XMLString text , Augmentations augs ) throws XNIException { } public void processingInstruction ( String target , XMLString data , Augmentations augs ) throws XNIException { } public void endGeneralEntity ( String name , Augmentations augs ) throws XNIException { } static final int INITIAL_STACK_SIZE = 8 ; static final int INC_STACK_SIZE = 8 ; private static final boolean DEBUG_NORMALIZATION = false ; private final XMLString fEmptyXMLStr = new XMLString ( null , 0 , ( - 1 ) ) ; private static final int BUFFER_SIZE = 20 ; private final XMLString fNormalizedStr = new XMLString ( ) ; private boolean fFirstChunk = true ; private boolean fTrailing = false ; private short fWhiteSpace = - 1 ; private boolean fUnionType = false ; final XSGrammarBucket fGrammarBucket ; final SubstitutionGroupHandler fSubGroupHandler ; final XMLSchemaLoader fSchemaLoader ; final XSSimpleType fQNameDV = ( ( XSSimpleType ) ( SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_QNAME ) ) ) ; final CMNodeFactory nodeFactory = new CMNodeFactory ( ) ; final CMBuilder fCMBuilder = new CMBuilder ( nodeFactory ) ; String fValidationRoot ; int fSkipValidationDepth ; int fNFullValidationDepth ; int fNNoneValidationDepth ; int fElementDepth ; boolean fSubElement ; boolean [ ] fSubElementStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; XSElementDecl fCurrentElemDecl ; XSElementDecl [ ] fElemDeclStack = new XSElementDecl [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; boolean fNil ; boolean [ ] fNilStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; XSNotationDecl fNotation ; XSNotationDecl [ ] fNotationStack = new XSNotationDecl [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; XSTypeDefinition fCurrentType ; XSTypeDefinition [ ] fTypeStack = new XSTypeDefinition [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; XSCMValidator fCurrentCM ; XSCMValidator [ ] fCMStack = new XSCMValidator [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; int [ ] fCurrCMState ; int [ ] [ ] fCMStateStack = new int [ XMLSchemaValidator . INITIAL_STACK_SIZE ] [ ] ; boolean fStrictAssess = true ; boolean [ ] fStrictAssessStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; final StringBuffer fBuffer = new StringBuffer ( ) ; boolean fAppendBuffer = true ; boolean fSawText = false ; boolean [ ] fSawTextStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; boolean fSawCharacters = false ; boolean [ ] fStringContent = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; boolean fSawChildren = false ; boolean [ ] fSawChildrenStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; final QName fTempQName = new QName ( ) ; ValidatedInfo fValidatedInfo = new ValidatedInfo ( ) ; private ValidationState fState4XsiType = new ValidationState ( ) ; private ValidationState fState4ApplyDefault = new ValidationState ( ) ; protected XMLSchemaValidator . XPathMatcherStack fMatcherStack = new XMLSchemaValidator . XPathMatcherStack ( ) ; protected XMLSchemaValidator . ValueStoreCache fValueStoreCache = new XMLSchemaValidator . ValueStoreCache ( ) ; public XMLSchemaValidator ( ) { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { fXSIErrorReporter . reset ( ( ( XMLErrorReporter ) ( componentManager . getProperty ( XMLSchemaValidator . ERROR_REPORTER ) ) ) ) ; fSchemaLoader . setProperty ( XMLSchemaValidator . ERROR_REPORTER , fXSIErrorReporter . fErrorReporter ) ; SymbolTable symbolTable = ( ( SymbolTable ) ( componentManager . getProperty ( XMLSchemaValidator . SYMBOL_TABLE ) ) ) ; if ( symbolTable != ( fSymbolTable ) ) { fSchemaLoader . setProperty ( XMLSchemaValidator . SYMBOL_TABLE , symbolTable ) ; fSymbolTable = symbolTable ; } try { fDynamicValidation = componentManager . getFeature ( XMLSchemaValidator . DYNAMIC_VALIDATION ) ; } catch ( XMLConfigurationException e ) { fDynamicValidation = false ; } if ( fDynamicValidation ) { fDoValidation = true ; } else { try { fDoValidation = componentManager . getFeature ( XMLSchemaValidator . VALIDATION ) ; } catch ( XMLConfigurationException e ) { fDoValidation = false ; } } if ( fDoValidation ) { try { <START_BUG> fDoValidation = componentManager . getFeature ( this . SCHEMA_VALIDATION ) ; <END_BUG> } catch ( XMLConfigurationException e ) { } } try { fFullChecking = componentManager . getFeature ( XMLSchemaValidator . SCHEMA_FULL_CHECKING ) ; } catch ( XMLConfigurationException e ) { fFullChecking = false ; } fSchemaLoader . setFeature ( XMLSchemaValidator . SCHEMA_FULL_CHECKING , false ) ; try { fNormalizeData = componentManager . getFeature ( XMLSchemaValidator . NORMALIZE_DATA ) ; } catch ( XMLConfigurationException e ) { fNormalizeData = false ; } try { fSchemaElementDefault = componentManager . getFeature ( XMLSchemaValidator . SCHEMA_ELEMENT_DEFAULT ) ; } catch ( XMLConfigurationException e ) { fSchemaElementDefault = false ; } try { fAugPSVI = componentManager . getFeature ( XMLSchemaValidator . SCHEMA_AUGMENT_PSVI ) ; } catch ( XMLConfigurationException e ) { fAugPSVI = true ; } try { fSchemaType = ( ( String ) ( componentManager . getProperty ( ( ( Constants . JAXP_PROPERTY_PREFIX ) + ( Constants . SCHEMA_LANGUAGE ) ) ) ) ) ; } catch ( XMLConfigurationException e ) { fSchemaType = null ; } fEntityResolver = ( ( XMLEntityResolver ) ( componentManager . getProperty ( XMLSchemaValidator . ENTITY_MANAGER ) ) ) ; fSchemaLoader . setEntityResolver ( fEntityResolver ) ; fValidationManager = ( ( ValidationManager ) ( componentManager . getProperty ( XMLSchemaValidator . VALIDATION_MANAGER ) ) ) ; fValidationManager . addValidationState ( fValidationState ) ; fValidationState . setSymbolTable ( fSymbolTable ) ; fLocationPairs . clear ( ) ; try { fExternalSchemas = ( ( String ) ( componentManager . getProperty ( XMLSchemaValidator . SCHEMA_LOCATION ) ) ) ; fExternalNoNamespaceSchema = ( ( String ) ( componentManager . getProperty ( XMLSchemaValidator . SCHEMA_NONS_LOCATION ) ) ) ; } catch ( XMLConfigurationException e ) { fExternalSchemas = null ; fExternalNoNamespaceSchema = null ; } fSchemaLoader . setProperty ( XMLSchemaValidator . SCHEMA_LOCATION , fExternalSchemas ) ; fSchemaLoader . setProperty ( XMLSchemaValidator . SCHEMA_NONS_LOCATION , fExternalNoNamespaceSchema ) ;

Fix:
fDoValidation = componentManager . getFeature ( XMLSchemaValidator . SCHEMA_VALIDATION ) ;