Buggy code:
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 Boolean [ ] FEATURE_DEFAULTS = new Boolean [ ] { null , Boolean . FALSE } ; private static final String [ ] RECOGNIZED_PROPERTIES = new String [ ] { SYMBOL_TABLE , ERROR_REPORTER , ENTITY_MANAGER } ; private static final Object [ ] PROPERTY_DEFAULTS = new Object [ ] { null , null , null } ; 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 fSeenPEReferences ; private boolean fStartDTDCalled ; 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 final String [ ] fStrings = new String [ 3 ] ; private final XMLString fString = new XMLString ( ) ; private final XMLStringBuffer fStringBuffer = new XMLStringBuffer ( ) ; private final XMLStringBuffer fStringBuffer2 = new XMLStringBuffer ( ) ; private final XMLString fLiteral = new XMLString ( ) ; private final XMLString fLiteral2 = new XMLString ( ) ; private String [ ] fEnumeration = new String [ 5 ] ; private int fEnumerationCount ; private final XMLStringBuffer fIgnoreConditionalBuffer = new XMLStringBuffer ( 128 ) ; public XMLDTDScannerImpl ( ) { } public XMLDTDScannerImpl ( SymbolTable symbolTable , XMLErrorReporter errorReporter , XMLEntityManager entityManager ) { } 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 void reset ( ) { } public String [ ] getRecognizedFeatures ( ) { } public String [ ] getRecognizedProperties ( ) { } public Boolean getFeatureDefault ( String featureId ) { } public Object getPropertyDefault ( String propertyId ) { } public void setDTDHandler ( XMLDTDHandler dtdHandler ) { } public XMLDTDHandler getDTDHandler ( ) { } public void setDTDContentModelHandler ( XMLDTDContentModelHandler dtdContentModelHandler ) { } public XMLDTDContentModelHandler getDTDContentModelHandler ( ) { } public void startEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void endEntity ( String name , Augmentations augs ) 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 { boolean isPEDecl = false ; boolean sawPERef = false ; fReportEntity = false ; if ( fEntityScanner . skipSpaces ( ) ) { if ( ! ( fEntityScanner . skipChar ( '%' ) ) ) { isPEDecl = false ; } else if ( skipSeparator ( true , ( ! ( scanningInternalSubset ( ) ) ) ) ) { isPEDecl = true ; } else if ( scanningInternalSubset ( ) ) { <START_BUG> reportFatalError ( "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL" , null ) ; <END_BUG> isPEDecl = true ; } else if ( ( fEntityScanner . peekChar ( ) ) == '%' ) { skipSeparator ( false , ( ! ( scanningInternalSubset ( ) ) ) ) ; isPEDecl = true ; } else { sawPERef = true ; } } else if ( ( scanningInternalSubset ( ) ) || ( ! ( fEntityScanner . skipChar ( '%' ) ) ) ) { reportFatalError ( "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_ENTITYDECL" , null ) ; isPEDecl = false ; } else if ( fEntityScanner . skipSpaces ( ) ) { reportFatalError ( "MSG_SPACE_REQUIRED_BEFORE_PERCENT_IN_PEDECL" , null ) ; isPEDecl = false ; } else { sawPERef = true ; } if ( sawPERef ) { while ( true ) { String peName = fEntityScanner . scanName ( ) ; if ( peName == null ) { reportFatalError ( "NameRequiredInPEReference" , null ) ; } else if ( ! ( fEntityScanner . skipChar ( ';' ) ) ) { reportFatalError ( "SemicolonRequiredInPEReference" , new Object [ ] { peName } ) ; } else { startPE ( peName , false ) ; } fEntityScanner . skipSpaces ( ) ; if ( ! ( fEntityScanner . skipChar ( '%' ) ) ) break ; if ( ! isPEDecl ) { if ( skipSeparator ( true , ( ! ( scanningInternalSubset ( ) ) ) ) ) { isPEDecl = true ; break ; } isPEDecl = fEntityScanner . skipChar ( '%' ) ; } } } String name = null ; if ( fNamespaces ) { name = fEntityScanner . scanNCName ( ) ; }

Fix:
reportFatalError ( "MSG_SPACE_REQUIRED_BEFORE_ENTITY_NAME_IN_PEDECL" , null ) ;