Buggy code:
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 { } public void startValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) throws XNIException { } public XPathMatcher activateField ( Field field , int initialDepth ) { } public void endValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) throws XNIException { } private void activateSelectorFor ( IdentityConstraint ic ) throws XNIException { } void ensureStackCapacity ( ) { } void handleStartDocument ( XMLLocator locator , String encoding ) { } void handleEndDocument ( ) { } XMLString handleCharacters ( XMLString text ) { } private void normalizeWhitespace ( XMLString value , boolean collapse ) { } private void normalizeWhitespace ( String value , boolean collapse ) { } void handleIgnorableWhitespace ( XMLString text ) { } Augmentations handleStartElement ( QName element , XMLAttributes attributes , Augmentations augs ) { } Augmentations handleEndElement ( QName element , Augmentations augs ) { } final Augmentations endElementPSVI ( boolean root , SchemaGrammar [ ] grammars , Augmentations augs ) { } Augmentations getEmptyAugs ( Augmentations augs ) { if ( augs == null ) { augs = fAugmentations ; <START_BUG> augs . clear ( ) ; <END_BUG> } augs . putItem ( ELEMENT_PSVI , fCurrentPSVI ) ; fCurrentPSVI . reset ( ) ; return augs ; } void storeLocations ( String sLocation , String nsLocation ) { } SchemaGrammar findSchemaGrammar ( short contextType , String namespace , QName enclosingElement , QName triggeringComponet , XMLAttributes attributes ) { } XSTypeDefinition getAndCheckXsiType ( QName element , String xsiType , XMLAttributes attributes ) { } boolean getXsiNil ( QName element , String xsiNil ) { } void processAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processOneAttribute ( QName element , XMLAttributes attributes , int index , XSAttributeDecl currDecl , XSAttributeUseImpl currUse , AttributePSVImpl attrPSVI ) { } void addDefaultAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processElementContent ( QName element ) { } Object elementLocallyValidType ( QName element , Object textContent ) { } Object elementLocallyValidComplexType ( QName element , Object textContent ) { } void reportSchemaError ( String key , Object [ ] arguments ) { } protected static class XPathMatcherStack { protected XPathMatcher [ ] fMatchers = new XPathMatcher [ 4 ] ; protected int fMatchersCount ; protected IntStack fContextStack = new IntStack ( ) ; public XPathMatcherStack ( ) { } public void clear ( ) { } public int size ( ) { } public int getMatcherCount ( ) { } public void addMatcher ( XPathMatcher matcher ) { } public XPathMatcher getMatcherAt ( int index ) { } public void pushContext ( ) { } public void popContext ( ) { } private void ensureMatcherCapacity ( ) { } } protected abstract class ValueStoreBase implements ValueStore { protected IDValue NOT_AN_IDVALUE = new IDValue ( "￿" , null ) ; protected IdentityConstraint fIdentityConstraint ; protected final XMLSchemaValidator . OrderedHashtable fValues = new XMLSchemaValidator . OrderedHashtable ( ) ; protected int fValuesCount ; protected final Vector fValueTuples = new Vector ( ) ; protected ValueStoreBase ( IdentityConstraint identityConstraint ) { } public void clear ( ) { }

Fix:
augs . removeAllItems ( ) ;