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 ; private final DOMErrorImpl fError = new DOMErrorImpl ( ) ; 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 DOMLocatorImpl fLocator = new DOMLocatorImpl ( ) ; protected Node fCurrentNode = null ; private QName fAttrQName = new QName ( ) ; final XMLString fNormalizedValue = new XMLString ( new char [ 16 ] , 0 , 0 ) ; public static final RuntimeException abort = new RuntimeException ( ) ; public static final XMLString EMPTY_STRING = new XMLString ( ) ; private boolean fAllWhitespace = false ; public DOMNormalizer ( ) { } protected void normalizeDocument ( CoreDocumentImpl document , DOMConfigurationImpl config ) { fDocument = document ; fConfiguration = config ; fAllWhitespace = false ; fNamespaceValidation = false ; String xmlVersion = fDocument . getXmlVersion ( ) ; String schemaType = null ; String [ ] schemaLocations = null ; fSymbolTable = ( ( SymbolTable ) ( fConfiguration . getProperty ( SYMBOL_TABLE ) ) ) ; fNamespaceContext . reset ( ) ; fNamespaceContext . declarePrefix ( XMLSymbols . EMPTY_STRING , null ) ; if ( ( ( fConfiguration . features ) & ( DOMConfigurationImpl . VALIDATE ) ) != 0 ) { String schemaLang = ( ( String ) ( fConfiguration . getProperty ( JAXP_SCHEMA_LANGUAGE ) ) ) ; if ( ( schemaLang != null ) && ( schemaLang . equals ( NS_XMLSCHEMA ) ) ) { schemaType = XMLGrammarDescription . XML_SCHEMA ; fValidationHandler = singleton . getValidator ( schemaType , xmlVersion ) ; fConfiguration . setFeature ( SCHEMA , true ) ; fConfiguration . setFeature ( SCHEMA_FULL_CHECKING , true ) ; fNamespaceValidation = true ; fPSVI = ( ( ( fConfiguration . features ) & ( DOMConfigurationImpl . PSVI ) ) != 0 ) ? true : false ; } else { schemaType = XMLGrammarDescription . XML_DTD ; if ( schemaLang != null ) { schemaLocations = ( ( String [ ] ) ( fConfiguration . getProperty ( JAXP_SCHEMA_SOURCE ) ) ) ; } fConfiguration . setDTDValidatorFactory ( xmlVersion ) ; fValidationHandler = singleton . getValidator ( schemaType , xmlVersion ) ; fPSVI = false ; } fConfiguration . setFeature ( XERCES_VALIDATION , true ) ; fDocument . clearIdentifiers ( ) ; if ( ( fValidationHandler ) != null ) { ( ( XMLComponent ) ( fValidationHandler ) ) . reset ( fConfiguration ) ; } } else { fValidationHandler = null ; } fErrorHandler = ( ( DOMErrorHandler ) ( fConfiguration . getParameter ( DOM_ERROR_HANDLER ) ) ) ; if ( ( fValidationHandler ) != null ) { fValidationHandler . setDocumentHandler ( this ) ; fValidationHandler . startDocument ( new org . apache . xerces . impl . xs . util . SimpleLocator ( fDocument . fDocumentURI , fDocument . fDocumentURI , ( - 1 ) , ( - 1 ) ) , fDocument . encoding , fNamespaceContext , null ) ; fValidationHandler . xmlDecl ( fDocument . getXmlVersion ( ) , fDocument . getXmlEncoding ( ) , ( fDocument . getXmlStandalone ( ) ? "yes" : "no" ) , null ) ; } try { if ( schemaType == ( XMLGrammarDescription . XML_DTD ) ) { <START_BUG> processDTD ( xmlVersion , schemaLocations [ 0 ] ) ; <END_BUG> } Node kid ; Node next ; for ( kid = fDocument . getFirstChild ( ) ; kid != null ; kid = next ) { next = kid . getNextSibling ( ) ; kid = normalizeNode ( kid ) ; if ( kid != null ) { next = kid ; } } if ( ( fValidationHandler ) != null ) { fValidationHandler . endDocument ( null ) ; fValidationHandler . setDocumentHandler ( null ) ; singleton . releaseValidator ( schemaType , xmlVersion , fValidationHandler ) ; fValidationHandler = null ; } } catch ( RuntimeException e ) { if ( ( fValidationHandler ) != null ) { fValidationHandler . setDocumentHandler ( null ) ; singleton . releaseValidator ( schemaType , xmlVersion , fValidationHandler ) ; fValidationHandler = null ; } if ( e == ( DOMNormalizer . abort ) ) { return ; } throw e ; } } protected Node normalizeNode ( Node node ) { } private void processDTD ( String xmlVersion , String schemaLocation ) { } protected final void expandEntityRef ( Node parent , Node reference ) { } protected final void namespaceFixUp ( ElementImpl element , AttributeMap attributes ) { } protected final void addNamespaceDecl ( String prefix , String uri , ElementImpl element ) { } public static final void isCDataWF ( DOMErrorHandler errorHandler , DOMErrorImpl error , DOMLocatorImpl locator , String datavalue , boolean isXML11Version ) { } public static final void isXMLCharWF ( DOMErrorHandler errorHandler , DOMErrorImpl error , DOMLocatorImpl locator , String datavalue , boolean isXML11Version ) { } public static final void isCommentWF ( DOMErrorHandler errorHandler , DOMErrorImpl error , DOMLocatorImpl locator , String datavalue , boolean isXML11Version ) { } public static final void isAttrValueWF ( DOMErrorHandler errorHandler , DOMErrorImpl error , DOMLocatorImpl locator , NamedNodeMap attributes , Attr a , String value , boolean xml11Version ) { } public static final void reportDOMError ( DOMErrorHandler errorHandler , DOMErrorImpl error , DOMLocatorImpl locator , String message , short severity , String type ) { }

Fix:
processDTD ( xmlVersion , ( schemaLocations != null ? schemaLocations [ 0 ] : null ) ) ;