Buggy code:
private String fENTITIESSymbol ; private String fNMTOKENSymbol ; private String fNMTOKENSSymbol ; private String fNOTATIONSymbol ; private String fENUMERATIONSymbol ; private String fIMPLIEDSymbol ; private String fREQUIREDSymbol ; private String fFIXEDSymbol ; private String fDATATYPESymbol ; private IDDatatypeValidator fValID ; private IDREFDatatypeValidator fValIDRef ; private ListDatatypeValidator fValIDRefs ; private ENTITYDatatypeValidator fValENTITY ; private ListDatatypeValidator fValENTITIES ; private DatatypeValidator fValNMTOKEN ; private DatatypeValidator fValNMTOKENS ; private NOTATIONDatatypeValidator fValNOTATION ; private Hashtable fTableOfIDs ; private Hashtable fTableOfIDAttributeNames ; private Hashtable fTableOfNOTATIONAttributeNames ; private Hashtable fNotationEnumVals ; public XMLDTDValidator ( ) { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } public String [ ] getRecognizedFeatures ( ) { } public void setFeature ( String featureId , boolean state ) throws XMLConfigurationException { } public String [ ] getRecognizedProperties ( ) { } public void setProperty ( String propertyId , Object value ) throws XMLConfigurationException { } public void setDocumentHandler ( XMLDocumentHandler documentHandler ) { } public void setDTDHandler ( XMLDTDHandler dtdHandler ) { } public void setDTDContentModelHandler ( XMLDTDContentModelHandler dtdContentModelHandler ) { } public void startDocument ( XMLLocator locator , String encoding , 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 startPrefixMapping ( String prefix , String uri , 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 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 endPrefixMapping ( String prefix , 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 startEntity ( String name , String publicId , String systemId , String baseSystemId , String encoding , Augmentations augs ) throws XNIException { } public void textDecl ( String version , String encoding , 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 endEntity ( String name , Augmentations augs ) throws XNIException { } public void startDTD ( XMLLocator locator ) throws XNIException { } public void comment ( XMLString text ) throws XNIException { } public void characters ( XMLString text ) throws XNIException { } public void textDecl ( String version , String encoding ) 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 processingInstruction ( String target , XMLString data ) throws XNIException { } public void elementDecl ( String name , String contentModel ) throws XNIException { } public void startAttlist ( String elementName ) throws XNIException { } public void attributeDecl ( String elementName , String attributeName , String type , String [ ] enumeration , String defaultType , XMLString defaultValue ) throws XNIException { <START_BUG> if ( type != ( fCDATASymbol ) ) { <END_BUG> normalizeDefaultAttrValue ( defaultValue ) ; } if ( fValidation ) { if ( type == ( fIDSymbol ) ) { if ( ( defaultValue != null ) && ( ( defaultValue . length ) != 0 ) ) { if ( ( defaultType == null ) || ( ! ( ( defaultType == ( fIMPLIEDSymbol ) ) || ( defaultType == ( fREQUIREDSymbol ) ) ) ) ) { fErrorReporter . reportError ( XML_DOMAIN , "IDDefaultTypeInvalid" , new Object [ ] { attributeName } , SEVERITY_ERROR ) ; } } if ( ! ( fTableOfIDAttributeNames . containsKey ( elementName ) ) ) { fTableOfIDAttributeNames . put ( elementName , attributeName ) ; } else { String previousIDAttributeName = ( ( String ) ( fTableOfIDAttributeNames . get ( elementName ) ) ) ; fErrorReporter . reportError ( XML_DOMAIN , "MSG_MORE_THAN_ONE_ID_ATTRIBUTE" , new Object [ ] { elementName , previousIDAttributeName , attributeName } , SEVERITY_ERROR ) ; } } if ( type == ( fNOTATIONSymbol ) ) { for ( int i = 0 ; i < ( enumeration . length ) ; i ++ ) { fNotationEnumVals . put ( enumeration [ i ] , attributeName ) ; } if ( ( fTableOfNOTATIONAttributeNames . containsKey ( elementName ) ) == false ) { fTableOfNOTATIONAttributeNames . put ( elementName , attributeName ) ; } else { String previousNOTATIONAttributeName = ( ( String ) ( fTableOfNOTATIONAttributeNames . get ( elementName ) ) ) ; fErrorReporter . reportError ( XML_DOMAIN , "MSG_MORE_THAN_ONE_NOTATION_ATTRIBUTE" , new Object [ ] { elementName , previousNOTATIONAttributeName , attributeName } , SEVERITY_ERROR ) ; } } boolean ok = true ; if ( ( defaultValue != null ) && ( ( defaultType == null ) || ( ( defaultType != null ) && ( defaultType == ( fFIXEDSymbol ) ) ) ) ) { String value = defaultValue . toString ( ) ; if ( ( ( type == ( fNMTOKENSSymbol ) ) || ( type == ( fENTITIESSymbol ) ) ) || ( type == ( fIDREFSSymbol ) ) ) { StringTokenizer tokenizer = new StringTokenizer ( value ) ; if ( tokenizer . hasMoreTokens ( ) ) { while ( true ) { String nmtoken = tokenizer . nextToken ( ) ;

Fix:
if ( ( type != ( fCDATASymbol ) ) && ( defaultValue != null ) ) {