Buggy code:
public class DOMNormalizer implements XMLGrammarPool { protected static final boolean DEBUG_ND = false ; protected static final boolean DEBUG = false ; protected static final String PREFIX = "NS" ; protected static final String ERROR_HANDLER = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . ERROR_HANDLER_PROPERTY ) ; protected static final String SYMBOL_TABLE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . SYMBOL_TABLE_PROPERTY ) ; protected CoreDocumentImpl fDocument = null ; protected final DOMNormalizer . XMLAttributesProxy fAttrProxy = new DOMNormalizer . XMLAttributesProxy ( ) ; protected final QName fQName = new QName ( ) ; protected RevalidationHandler fValidationHandler ; protected SymbolTable fSymbolTable ; protected DOMErrorHandler fErrorHandler ; protected String fEmptySymbol ; protected String fXmlSymbol ; protected String fXmlnsSymbol ; protected int fNamespaceCounter = 1 ; protected final NamespaceSupport fNamespaceBinder = new NamespaceSupport ( ) ; protected final NamespaceSupport fLocalNSBinder = new NamespaceSupport ( ) ; protected final Vector fAttributeList = new Vector ( 5 , 10 ) ; protected final DOMErrorImpl fDOMError = new DOMErrorImpl ( ) ; public DOMNormalizer ( ) { } protected void reset ( XMLComponentManager componentManager ) { } protected void setValidationHandler ( RevalidationHandler validator ) { } protected void normalizeDocument ( CoreDocumentImpl document ) { } protected Node normalizeNode ( Node node ) { } protected void expandEntityRef ( Node node , Node parent , Node reference ) { } protected void namespaceFixUp ( ElementImpl element , AttributeMap attributes ) { } protected void addNamespaceDecl ( String prefix , String uri , ElementImpl element ) { } protected void removeDefault ( Attr attribute , AttributeMap attrMap ) { if ( ( ( fDocument . features ) & ( CoreDocumentImpl . DEFAULTS ) ) != 0 ) { if ( ! ( attribute . getSpecified ( ) ) ) { if ( DOMNormalizer . DEBUG_ND ) { System . out . println ( ( "==>remove<seq2seq4repair_space>default<seq2seq4repair_space>attr:<seq2seq4repair_space>" + ( attribute . getNodeName ( ) ) ) ) ; } <START_BUG> attrMap . removeItem ( attribute ) ; <END_BUG> } } } protected DOMError modifyDOMError ( String message , short severity , Node node ) { } protected void updateQName ( Node node , QName qname ) { } protected final class XMLAttributesProxy implements XMLAttributes { protected AttributeMap fAttributes ; protected CoreDocumentImpl fDocument ; protected ElementImpl fElement ; protected final Vector fAugmentations = new Vector ( 5 ) ; public void setAttributes ( AttributeMap attributes , CoreDocumentImpl doc , ElementImpl elem ) { } public int addAttribute ( QName attrQName , String attrType , String attrValue ) { } public void removeAllAttributes ( ) { } public void removeAttributeAt ( int attrIndex ) { } public int getLength ( ) { } public int getIndex ( String qName ) { } public int getIndex ( String uri , String localPart ) { } public void setName ( int attrIndex , QName attrName ) { } public void getName ( int attrIndex , QName attrName ) { } public String getPrefix ( int index ) { } public String getURI ( int index ) { } public String getLocalName ( int index ) { } public String getQName ( int index ) { } public void setType ( int attrIndex , String attrType ) { } public String getType ( int index ) { } public String getType ( String qName ) { } public String getType ( String uri , String localName ) { } public void setValue ( int attrIndex , String attrValue ) { } public String getValue ( int index ) { } public String getValue ( String qName ) { } public String getValue ( String uri , String localName ) { } public void setNonNormalizedValue ( int attrIndex , String attrValue ) { } public String getNonNormalizedValue ( int attrIndex ) { } public void setSpecified ( int attrIndex , boolean specified ) { } public boolean isSpecified ( int attrIndex ) { } public Augmentations getAugmentations ( int attributeIndex ) { } public Augmentations getAugmentations ( String uri , String localPart ) { } public Augmentations getAugmentations ( String qName ) { } } protected final Grammar [ ] fGrammarPool = new Grammar [ 1 ] ; public Grammar [ ] retrieveInitialGrammarSet ( String grammarType ) { } public void cacheGrammars ( String grammarType , Grammar [ ] grammars ) { } public Grammar retrieveGrammar ( XMLGrammarDescription desc ) { } public void lockPool ( ) { } public void unlockPool ( ) { } public void clear ( ) { } }

Fix:
attrMap . removeItem ( attribute , false ) ;