Buggy code:
public class XMLSchemaValidator implements FieldActivator , XMLComponent , XMLDocumentFilter { private static final boolean DEBUG = false ; protected static final String NAMESPACES = ( Constants . SAX_FEATURE_PREFIX ) + ( Constants . NAMESPACES_FEATURE ) ; protected static final String VALIDATION = ( Constants . SAX_FEATURE_PREFIX ) + ( Constants . VALIDATION_FEATURE ) ; protected static final String SCHEMA_VALIDATION = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . SCHEMA_VALIDATION_FEATURE ) ; protected static final String SCHEMA_FULL_CHECKING = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . SCHEMA_FULL_CHECKING ) ; protected static final String DYNAMIC_VALIDATION = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . DYNAMIC_VALIDATION_FEATURE ) ; public static final String SYMBOL_TABLE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SYMBOL_TABLE_PROPERTY ) ; public static final String ERROR_REPORTER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_REPORTER_PROPERTY ) ; public static final String ENTITY_RESOLVER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ENTITY_RESOLVER_PROPERTY ) ; public static final String GRAMMAR_POOL = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . GRAMMAR_POOL_PROPERTY ) ; protected static final String VALIDATION_MANAGER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . VALIDATION_MANAGER_PROPERTY ) ; protected static final String ENTITY_MANAGER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ENTITY_MANAGER_PROPERTY ) ; protected static final String SCHEMA_LOCATION = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SCHEMA_LOCATION ) ; protected static final String SCHEMA_NONS_LOCATION = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SCHEMA_NONS_LOCATION ) ; protected static final String [ ] RECOGNIZED_FEATURES = new String [ ] { XMLSchemaValidator . VALIDATION , XMLSchemaValidator . NAMESPACES , XMLSchemaValidator . SCHEMA_VALIDATION , XMLSchemaValidator . DYNAMIC_VALIDATION , XMLSchemaValidator . SCHEMA_FULL_CHECKING } ; protected static final String [ ] RECOGNIZED_PROPERTIES = new String [ ] { XMLSchemaValidator . SYMBOL_TABLE , XMLSchemaValidator . ERROR_REPORTER , XMLSchemaValidator . ENTITY_RESOLVER , XMLSchemaValidator . VALIDATION_MANAGER , XMLSchemaValidator . SCHEMA_LOCATION , XMLSchemaValidator . SCHEMA_NONS_LOCATION } ; protected boolean fSeenRoot = false ; protected boolean fNamespaces = false ; protected final ElementPSVImpl fElemPSVI = new ElementPSVImpl ( ) ; protected ElementPSVImpl fCurrentPSVI = null ; protected static final String ELEM_PSVI = "ELEM_PSVI" ; protected static final String ATTR_PSVI = "ATTR_PSVI" ; protected boolean fValidation = false ; protected boolean fDynamicValidation = false ; protected boolean fDoValidation = false ; protected boolean fFullChecking = false ; protected SymbolTable fSymbolTable ; class XSIErrorReporter { XMLErrorReporter fErrorReporter ; Vector fErrors = new Vector ( XMLSchemaValidator . INITIAL_STACK_SIZE , XMLSchemaValidator . INC_STACK_SIZE ) ; int [ ] fContext = new int [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; int fContextCount ; public void reset ( XMLErrorReporter errorReporter ) { fErrorReporter = errorReporter ; <START_BUG> fErrors . clear ( ) ; <END_BUG> fContextCount = 0 ; } public void pushContext ( ) { } public String [ ] popContext ( ) { } public void reportError ( String domain , String key , Object [ ] arguments , short severity ) throws XNIException { } public void reportError ( XMLLocator location , String domain , String key , Object [ ] arguments , short severity ) throws XNIException { } } protected XMLSchemaValidator . XSIErrorReporter fXSIErrorReporter = new XMLSchemaValidator . XSIErrorReporter ( ) ; protected XMLEntityResolver fEntityResolver ; protected ValidationManager fValidationManager = null ; protected ValidationState fValidationState = null ; protected GrammarPool fGrammarPool ; protected String fExternalSchemas = null ; protected String fExternalNoNamespaceSchema = null ; protected XMLDocumentHandler fDocumentHandler ; public String [ ] getRecognizedFeatures ( ) { } public void setFeature ( String featureId , boolean state ) throws XMLConfigurationException { } public String [ ] getRecognizedProperties ( ) { } public void setProperty ( String propertyId , Object value ) throws XMLConfigurationException { } public void setDocumentHandler ( XMLDocumentHandler documentHandler ) { } public void startDocument ( XMLLocator locator , String encoding , Augmentations augs ) throws XNIException { } public void xmlDecl ( String version , String encoding , String standalone , Augmentations augs ) throws XNIException { } public void doctypeDecl ( String rootElement , String publicId , String systemId , Augmentations augs ) throws XNIException { } public void startPrefixMapping ( String prefix , String uri , Augmentations augs ) throws XNIException { } public void startElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { } public void emptyElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { } public void characters ( XMLString text , Augmentations augs ) throws XNIException { } public void ignorableWhitespace ( XMLString text , Augmentations augs ) throws XNIException { } public void endElement ( QName element , Augmentations augs ) throws XNIException { } public void endPrefixMapping ( String prefix , Augmentations augs ) throws XNIException { } public void startCDATA ( Augmentations augs ) throws XNIException { } public void endCDATA ( Augmentations augs ) throws XNIException { } public void endDocument ( Augmentations augs ) throws XNIException { } public void startEntity ( String name , String publicId , String systemId , String baseSystemId , 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 endEntity ( String name , Augmentations augs ) throws XNIException { } static final int INITIAL_STACK_SIZE = 8 ; static final int INC_STACK_SIZE = 8 ; String XMLNS ; String URI_XSI ; String XSI_SCHEMALOCATION ; String XSI_NONAMESPACESCHEMALOCATION ; String XSI_TYPE ; String XSI_NIL ; String URI_SCHEMAFORSCHEMA ; final XSGrammarResolver fGrammarResolver ; final SubstitutionGroupHandler fSubGroupHandler ; final XSDHandler fSchemaHandler ; final NamespaceSupport fNamespaceSupport = new NamespaceSupport ( ) ; boolean fPushForNextBinding ; final XSSimpleType fQNameDV = ( ( XSSimpleType ) ( SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_QNAME ) ) ) ;

Fix:
fErrors . removeAllElements ( ) ;