Buggy code:
public class DTDGrammar extends Grammar implements XMLDTDContentModelHandler , XMLDTDHandler { private static final int CHUNK_SHIFT = 8 ; private static final int CHUNK_SIZE = 1 << ( DTDGrammar . CHUNK_SHIFT ) ; private static final int CHUNK_MASK = ( DTDGrammar . CHUNK_SIZE ) - 1 ; private static final int INITIAL_CHUNK_COUNT = 1 << ( 10 - ( DTDGrammar . CHUNK_SHIFT ) ) ; private static final boolean DEBUG = false ; protected DatatypeValidatorFactory fDatatypeValidatorFactory ; protected int fCurrentElementIndex ; protected int fCurrentAttributeIndex ; protected boolean fReadingExternalDTD = false ; private boolean fMixed ; private XMLElementDecl fElementDecl = new XMLElementDecl ( ) ; private XMLAttributeDecl fAttributeDecl = new XMLAttributeDecl ( ) ; private QName fQName = new QName ( ) ; private XMLEntityDecl fEntityDecl = new XMLEntityDecl ( ) ; private XMLSimpleType fSimpleType = new XMLSimpleType ( ) ; private XMLContentSpec fContentSpec = new XMLContentSpec ( ) ; Hashtable fAttributeDeclTab = new Hashtable ( ) ; Hashtable fElementDeclTab = new Hashtable ( ) ; Hashtable fNotationDeclTab = new Hashtable ( ) ; Hashtable fSimpleTypeTab = new Hashtable ( ) ; Hashtable fEntityDeclTab = new Hashtable ( ) ; private short [ ] fOpStack = null ; private int [ ] fNodeIndexStack = null ; private int [ ] fPrevNodeIndexStack = null ; private int fDepth = 0 ; private boolean [ ] fPEntityStack = new boolean [ 4 ] ; private int fPEDepth = 0 ; private int [ ] [ ] fElementDeclIsExternal = new int [ DTDGrammar . INITIAL_CHUNK_COUNT ] [ ] ; private int [ ] [ ] fAttributeDeclIsExternal = new int [ DTDGrammar . INITIAL_CHUNK_COUNT ] [ ] ; int valueIndex = - 1 ; int prevNodeIndex = - 1 ; int nodeIndex = - 1 ; public DTDGrammar ( SymbolTable symbolTable ) { } public void setDatatypeValidatorFactory ( DatatypeValidatorFactory factory ) { } public boolean getElementDeclIsExternal ( int elementDeclIndex ) { } public boolean getAttributeDeclIsExternal ( int attributeDeclIndex ) { } public int getAttributeDeclIndex ( int elementDeclIndex , String attributeDeclName ) { } public void startDTD ( XMLLocator locator ) throws XNIException { } public void startEntity ( String name , String publicId , String systemId , String baseSystemId , String encoding ) throws XNIException { } public void endEntity ( String name ) throws XNIException { } public void elementDecl ( String name , String contentModel ) throws XNIException { } public void attributeDecl ( String elementName , String attributeName , String type , String [ ] enumeration , String defaultType , XMLString defaultValue ) throws XNIException { if ( this . fElementDeclTab . containsKey ( ( ( String ) ( elementName ) ) ) ) { } else { fCurrentElementIndex = createElementDecl ( ) ; XMLElementDecl elementDecl = new XMLElementDecl ( ) ; elementDecl . name . setValues ( null , elementName , elementName , null ) ; elementDecl . scope = - 1 ; this . fElementDeclTab . put ( elementName , elementDecl ) ; setElementDecl ( fCurrentElementIndex , elementDecl ) ; } int elementIndex = getElementDeclIndex ( elementName , ( - 1 ) ) ; if ( ( getAttributeDeclIndex ( elementIndex , attributeName ) ) != ( - 1 ) ) { return ; } fCurrentAttributeIndex = createAttributeDecl ( ) ; fSimpleType . clear ( ) ; if ( defaultType != null ) { if ( defaultType . equals ( "#FIXED" ) ) { fSimpleType . defaultType = fSimpleType . DEFAULT_TYPE_FIXED ; } else if ( defaultType . equals ( "#IMPLIED" ) ) { fSimpleType . defaultType = fSimpleType . DEFAULT_TYPE_IMPLIED ; } else if ( defaultType . equals ( "#REQUIRED" ) ) { fSimpleType . defaultType = fSimpleType . DEFAULT_TYPE_REQUIRED ; } } if ( DTDGrammar . DEBUG ) { System . out . println ( ( "defaultvalue<seq2seq4repair_space>=<seq2seq4repair_space>" + ( defaultValue . toString ( ) ) ) ) ; } <START_BUG> fSimpleType . defaultValue = ( ( defaultValue . length ) >= 0 ) ? defaultValue . toString ( ) : null ; <END_BUG> fSimpleType . enumeration = enumeration ; Hashtable facets = new Hashtable ( ) ; if ( type . equals ( "CDATA" ) ) { fSimpleType . type = XMLSimpleType . TYPE_CDATA ; } else if ( type . equals ( "ID" ) ) { fSimpleType . type = XMLSimpleType . TYPE_ID ; } else if ( type . startsWith ( "IDREF" ) ) { fSimpleType . type = XMLSimpleType . TYPE_IDREF ; if ( ( type . indexOf ( "S" ) ) > 0 ) { fSimpleType . list = true ; } } else if ( type . equals ( "ENTITIES" ) ) { fSimpleType . type = XMLSimpleType . TYPE_ENTITY ; fSimpleType . list = true ; } else if ( type . equals ( "ENTITY" ) ) { fSimpleType . type = XMLSimpleType . TYPE_ENTITY ; } else if ( type . equals ( "NMTOKENS" ) ) { fSimpleType . type = XMLSimpleType . TYPE_NMTOKEN ; fSimpleType . list = true ; } else if ( type . equals ( "NMTOKEN" ) ) { fSimpleType . type = XMLSimpleType . TYPE_NMTOKEN ; } else if ( type . startsWith ( "NOTATION" ) ) { fSimpleType . type = XMLSimpleType . TYPE_NOTATION ; facets . put ( "enumeration" , fSimpleType . enumeration ) ; } else if ( type . startsWith ( "ENUMERATION" ) ) { fSimpleType . type = XMLSimpleType . TYPE_ENUMERATION ; facets . put ( "enumeration" , fSimpleType . enumeration ) ; } else { System . err . println ( ( "!!!<seq2seq4repair_space>unknown<seq2seq4repair_space>attribute<seq2seq4repair_space>type<seq2seq4repair_space>" + type ) ) ; } fQName . setValues ( null , attributeName , attributeName , null ) ; fAttributeDecl . setValues ( fQName , fSimpleType , false ) ; setAttributeDecl ( elementIndex , fCurrentAttributeIndex , fAttributeDecl ) ; int chunk = ( fCurrentAttributeIndex ) > > ( DTDGrammar . CHUNK_SHIFT ) ; int index = ( fCurrentAttributeIndex ) & ( DTDGrammar . CHUNK_MASK ) ; ensureAttributeDeclCapacity ( chunk ) ;

Fix:
fSimpleType . defaultValue = ( defaultValue != null ) ? defaultValue . toString ( ) : null ;