Buggy code:
void reportSchemaError ( String key , Object [ ] arguments ) { } private String expectedStr ( Vector expected ) { } 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 IdentityConstraint fIdentityConstraint ; protected int fFieldCount = 0 ; protected Field [ ] fFields = null ; protected Object [ ] fLocalValues = null ; protected short [ ] fLocalValueTypes = null ; protected ShortList [ ] fLocalItemValueTypes = null ; protected int fValuesCount ; public final Vector fValues = new Vector ( ) ; public XMLSchemaValidator . ShortVector fValueTypes = null ; public Vector fItemValueTypes = null ; private boolean fUseValueTypeVector = false ; private int fValueTypesLength = 0 ; private short fValueType = 0 ; private boolean fUseItemValueTypeVector = false ; private int fItemValueTypesLength = 0 ; private ShortList fItemValueType = null ; final StringBuffer fTempBuffer = new StringBuffer ( ) ; protected ValueStoreBase ( IdentityConstraint identityConstraint ) { } public void clear ( ) { } public void append ( XMLSchemaValidator . ValueStoreBase newVal ) { } public void startValueScope ( ) { } public void endValueScope ( ) { } public void endDocumentFragment ( ) { } public void endDocument ( ) { } public void reportError ( String key , Object [ ] args ) { } public void addValue ( Field field , boolean mayMatch , Object actualValue , short valueType , ShortList itemValueType ) { } public boolean contains ( ) { } public int contains ( XMLSchemaValidator . ValueStoreBase vsb ) { } protected void checkDuplicateValues ( ) { } protected String toString ( Object [ ] values ) { } protected String toString ( Vector values , int start , int length ) { } public String toString ( ) { } private void addValueType ( short type ) { } private short getValueTypeAt ( int index ) { } private boolean valueTypeContains ( short value ) { } private void addItemValueType ( ShortList itemValueType ) { } private ShortList getItemValueTypeAt ( int index ) { } private boolean itemValueTypeContains ( ShortList value ) { } } protected class UniqueValueStore extends XMLSchemaValidator . ValueStoreBase { public UniqueValueStore ( UniqueOrKey unique ) { } protected void checkDuplicateValues ( ) { } } protected class KeyValueStore extends XMLSchemaValidator . ValueStoreBase { public KeyValueStore ( UniqueOrKey key ) { } protected void checkDuplicateValues ( ) { } } protected class KeyRefValueStore extends XMLSchemaValidator . ValueStoreBase { protected XMLSchemaValidator . ValueStoreBase fKeyValueStore ; public KeyRefValueStore ( KeyRef keyRef , XMLSchemaValidator . KeyValueStore keyValueStore ) { } public void endDocumentFragment ( ) { } public void endDocument ( ) { } } protected class ValueStoreCache { final XMLSchemaValidator . LocalIDKey fLocalId = new XMLSchemaValidator . LocalIDKey ( ) ; protected final ArrayList fValueStores = new ArrayList ( ) ; protected final HashMap fIdentityConstraint2ValueStoreMap = new HashMap ( ) ; protected final Stack fGlobalMapStack = new Stack ( ) ; protected final HashMap fGlobalIDConstraintMap = new HashMap ( ) ; public ValueStoreCache ( ) { } public void startDocument ( ) { } public void startElement ( ) { } public void endElement ( ) { if ( fGlobalMapStack . isEmpty ( ) ) { return ; } <START_BUG> Hashtable oldMap = ( ( Hashtable ) ( fGlobalMapStack . pop ( ) ) ) ; <END_BUG> if ( oldMap == null ) { return ; } Iterator entries = oldMap . entrySet ( ) . iterator ( ) ; while ( entries . hasNext ( ) ) { Map . Entry entry = ( ( Map . Entry ) ( entries . next ( ) ) ) ; IdentityConstraint id = ( ( IdentityConstraint ) ( entry . getKey ( ) ) ) ; XMLSchemaValidator . ValueStoreBase oldVal = ( ( XMLSchemaValidator . ValueStoreBase ) ( entry . getValue ( ) ) ) ; if ( oldVal != null ) { XMLSchemaValidator . ValueStoreBase currVal = ( ( XMLSchemaValidator . ValueStoreBase ) ( fGlobalIDConstraintMap . get ( id ) ) ) ; if ( currVal == null ) { fGlobalIDConstraintMap . put ( id , oldVal ) ; } else if ( currVal != oldVal ) { currVal . append ( oldVal ) ; } } } } public void initValueStoresFor ( XSElementDecl eDecl , FieldActivator activator ) { } public XMLSchemaValidator . ValueStoreBase getValueStoreFor ( IdentityConstraint id , int initialDepth ) { } public XMLSchemaValidator . ValueStoreBase getGlobalValueStoreFor ( IdentityConstraint id ) { } public void transplant ( IdentityConstraint id , int initialDepth ) { } public void endDocument ( ) { } public String toString ( ) { } } protected static final class LocalIDKey { public IdentityConstraint fId ; public int fDepth ; public LocalIDKey ( ) { } public LocalIDKey ( IdentityConstraint id , int depth ) { } public int hashCode ( ) { } public boolean equals ( Object localIDKey ) { } } protected static final class ShortVector { private int fLength ; private short [ ] fData ; public ShortVector ( ) { } public ShortVector ( int initialCapacity ) { } public int length ( ) { } public void add ( short value ) { } public short valueAt ( int position ) { } public void clear ( ) { } public boolean contains ( short value ) { } private void ensureCapacity ( int size ) { }

Fix:
HashMap oldMap = ( ( HashMap ) ( fGlobalMapStack . pop ( ) ) ) ;