Buggy code:
public class XMLDTDScannerImpl extends XMLScanner implements XMLEntityHandler , XMLComponent , XMLDTDScanner { protected static final int SCANNER_STATE_END_OF_INPUT = 0 ; protected static final int SCANNER_STATE_TEXT_DECL = 1 ; protected static final int SCANNER_STATE_MARKUP_DECL = 2 ; private static final String [ ] RECOGNIZED_FEATURES = new String [ ] { VALIDATION , NOTIFY_CHAR_REFS } ; private static final String [ ] RECOGNIZED_PROPERTIES = new String [ ] { SYMBOL_TABLE , ERROR_REPORTER , ENTITY_MANAGER } ; private static final boolean DEBUG_SCANNER_STATE = false ; protected XMLDTDHandler fDTDHandler ; protected XMLDTDContentModelHandler fDTDContentModelHandler ; protected int fScannerState ; protected boolean fStandalone ; protected boolean fSeenExternalDTD ; protected boolean fSeenExternalPE ; private boolean fStartDTDCalled ; private XMLAttributesImpl fAttributes = new XMLAttributesImpl ( ) ; private int [ ] fContentStack = new int [ 5 ] ; private int fContentDepth ; private int [ ] fPEStack = new int [ 5 ] ; private boolean [ ] fPEReport = new boolean [ 5 ] ; private int fPEDepth ; private int fMarkUpDepth ; private int fExtEntityDepth ; private int fIncludeSectDepth ; private String [ ] fStrings = new String [ 3 ] ; private XMLString fString = new XMLString ( ) ; private XMLStringBuffer fStringBuffer = new XMLStringBuffer ( ) ; private XMLStringBuffer fStringBuffer2 = new XMLStringBuffer ( ) ; private XMLString fLiteral = new XMLString ( ) ; private XMLString fLiteral2 = new XMLString ( ) ; private String [ ] fEnumeration = new String [ 5 ] ; private int fEnumerationCount ; private XMLStringBuffer fIgnoreConditionalBuffer = new XMLStringBuffer ( 128 ) ; public XMLDTDScannerImpl ( ) { } public void setInputSource ( XMLInputSource inputSource ) throws IOException { } public boolean scanDTDExternalSubset ( boolean complete ) throws IOException , XNIException { } public boolean scanDTDInternalSubset ( boolean complete , boolean standalone , boolean hasExternalSubset ) throws IOException , XNIException { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } public String [ ] getRecognizedFeatures ( ) { } public String [ ] getRecognizedProperties ( ) { } public void setDTDHandler ( XMLDTDHandler dtdHandler ) { } public void setDTDContentModelHandler ( XMLDTDContentModelHandler dtdContentModelHandler ) { } public void startEntity ( String name , XMLResourceIdentifier identifier , String encoding ) throws XNIException { super . startEntity ( name , identifier , encoding ) ; boolean dtdEntity = name . equals ( "[dtd]" ) ; if ( dtdEntity ) { if ( ( ( fDTDHandler ) != null ) && ( ! ( fStartDTDCalled ) ) ) { fDTDHandler . startDTD ( fEntityScanner , null ) ; } <START_BUG> fDTDHandler . startExternalSubset ( null ) ; <END_BUG> ( fExtEntityDepth ) ++ ; } else if ( ( name . charAt ( 0 ) ) == '%' ) { pushPEStack ( fMarkUpDepth , fReportEntity ) ; if ( fEntityScanner . isExternal ( ) ) { ( fExtEntityDepth ) ++ ; } } if ( ( ( ( fDTDHandler ) != null ) && ( ! dtdEntity ) ) && ( fReportEntity ) ) { fDTDHandler . startParameterEntity ( name , identifier , encoding , null ) ; } } public void endEntity ( String name ) throws XNIException { } protected final void setScannerState ( int state ) { } private static String getScannerStateName ( int state ) { } protected final boolean scanningInternalSubset ( ) { } protected void startPE ( String name , boolean literal ) throws IOException , XNIException { } protected final boolean scanTextDecl ( ) throws IOException , XNIException { } protected final void scanPIData ( String target , XMLString data ) throws IOException , XNIException { } protected final void scanComment ( ) throws IOException , XNIException { } protected final void scanElementDecl ( ) throws IOException , XNIException { } private final void scanMixed ( String elName ) throws IOException , XNIException { } private final void scanChildren ( String elName ) throws IOException , XNIException { } protected final void scanAttlistDecl ( ) throws IOException , XNIException { } private final String scanAttType ( String elName , String atName ) throws IOException , XNIException { } protected final String scanAttDefaultDecl ( String elName , String atName , String type , XMLString defaultVal , XMLString nonNormalizedDefaultVal ) throws IOException , XNIException { } private final void scanEntityDecl ( ) throws IOException , XNIException { } protected final void scanEntityValue ( XMLString value , XMLString nonNormalizedValue ) throws IOException , XNIException { } private final void scanNotationDecl ( ) throws IOException , XNIException { } private final void scanConditionalSect ( ) throws IOException , XNIException { } protected final boolean scanDecls ( boolean complete ) throws IOException , XNIException { } private boolean skipSeparator ( boolean spaceRequired , boolean lookForPERefs ) throws IOException , XNIException { } private final void pushContentStack ( int c ) { } private final int popContentStack ( ) { } private final void pushPEStack ( int depth , boolean report ) { } private final int popPEStack ( ) { } private final boolean peekReportEntity ( ) { } private final void ensureEnumerationSize ( int size ) { } }

Fix:
fDTDHandler . startExternalSubset ( fEntityScanner , null ) ;