Buggy code:
public class DOMNormalizer implements XMLDocumentHandler { protected static final boolean DEBUG_ND = false ; protected static final boolean DEBUG = false ; protected static final boolean DEBUG_EVENTS = false ; protected static final String PREFIX = "NS" ; protected DOMConfigurationImpl fConfiguration = null ; 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 boolean fNamespaceValidation = false ; protected boolean fPSVI = false ; protected final NamespaceContext fNamespaceContext = new NamespaceSupport ( ) ; protected final NamespaceContext fLocalNSBinder = new NamespaceSupport ( ) ; protected final Vector fAttributeList = new Vector ( 5 , 10 ) ; protected final DOMErrorImpl fDOMError = new DOMErrorImpl ( ) ; protected final DOMLocatorImpl fLocator = new DOMLocatorImpl ( ) ; protected Node fCurrentNode = null ; private QName fAttrQName = new QName ( ) ; final XMLString fNormalizedValue = new XMLString ( new char [ 16 ] , 0 , 0 ) ; public DOMNormalizer ( ) { } protected void normalizeDocument ( CoreDocumentImpl document , DOMConfigurationImpl config ) { } protected Node normalizeNode ( Node node ) { } protected final void expandEntityRef ( Node node , Node parent , Node reference ) { } protected final void namespaceFixUp ( ElementImpl element , AttributeMap attributes ) { } protected final void addNamespaceDecl ( String prefix , String uri , ElementImpl element ) { } protected final DOMError modifyDOMError ( String message , short severity , Node node ) { fDOMError . reset ( ) ; fDOMError . fMessage = message ; fDOMError . fSeverity = severity ; fDOMError . fLocator = fLocator ; <START_BUG> fLocator . fErrorNode = node ; <END_BUG> return fDOMError ; } protected final void updateQName ( Node node , QName qname ) { } final String normalizeAttributeValue ( String value , Attr attr ) { } 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 qname , 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 ) { } public void setAugmentations ( int attrIndex , Augmentations augs ) { } } public void startDocument ( XMLLocator locator , String encoding , NamespaceContext namespaceContext , 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 comment ( XMLString text , Augmentations augs ) throws XNIException { } public void processingInstruction ( String target , XMLString data , 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 startGeneralEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void textDecl ( String version , String encoding , Augmentations augs ) throws XNIException { } public void endGeneralEntity ( String name , 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 startCDATA ( Augmentations augs ) throws XNIException { } public void endCDATA ( Augmentations augs ) throws XNIException { } public void endDocument ( Augmentations augs ) throws XNIException { } public void setDocumentSource ( XMLDocumentSource source ) { } public XMLDocumentSource getDocumentSource ( ) { } }

Fix:
fLocator . fRelatedNode = node ;