Buggy code:
public abstract class AbstractDOMParser extends AbstractXMLDocumentParser { protected static final String NAMESPACES = ( Constants . SAX_FEATURE_PREFIX ) + ( Constants . NAMESPACES_FEATURE ) ; protected static final String CREATE_ENTITY_REF_NODES = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . CREATE_ENTITY_REF_NODES_FEATURE ) ; protected static final String INCLUDE_COMMENTS_FEATURE = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . INCLUDE_COMMENTS_FEATURE ) ; protected static final String CREATE_CDATA_NODES_FEATURE = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . CREATE_CDATA_NODES_FEATURE ) ; protected static final String INCLUDE_IGNORABLE_WHITESPACE = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . INCLUDE_IGNORABLE_WHITESPACE ) ; protected static final String DEFER_NODE_EXPANSION = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . DEFER_NODE_EXPANSION_FEATURE ) ; protected static final String NORMALIZE_DATA = ( Constants . XERCES_FEATURE_PREFIX ) + ( Constants . SCHEMA_NORMALIZED_VALUE ) ; protected static final String DOCUMENT_CLASS_NAME = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . DOCUMENT_CLASS_NAME_PROPERTY ) ; protected static final String CURRENT_ELEMENT_NODE = ( Constants . XERCES_PROPERTY_PREFIX ) + ( Constants . CURRENT_ELEMENT_NODE_PROPERTY ) ; protected static final String DEFAULT_DOCUMENT_CLASS_NAME = "org.apache.xerces.dom.DocumentImpl" ; private static final boolean DEBUG_ENTITY_REF = false ; private static final boolean DEBUG_EVENTS = false ; protected boolean fCreateEntityRefNodes ; protected boolean fIncludeIgnorableWhitespace ; protected boolean fIncludeComments ; protected boolean fCreateCDATANodes ; protected boolean fNormalizeData = true ; protected Document fDocument ; protected DocumentImpl fDocumentImpl ; protected String fDocumentClassName ; protected DocumentType fDocumentType ; protected Node fCurrentNode ; protected CDATASection fCurrentCDATASection ; protected StringBuffer fInternalSubset ; protected boolean fDeferNodeExpansion ; protected boolean fNamespaceAware ; protected DeferredDocumentImpl fDeferredDocumentImpl ; protected int fDocumentIndex ; protected int fDocumentTypeIndex ; protected int fCurrentNodeIndex ; protected int fCurrentCDATASectionIndex ; protected boolean fInDTDExternalSubset ; protected boolean fInDocument ; protected boolean fInCDATASection ; private QName fAttrQName = new QName ( ) ; protected AbstractDOMParser ( XMLParserConfiguration config ) { } protected String getDocumentClassName ( ) { } protected void setDocumentClassName ( String documentClassName ) { } public Document getDocument ( ) { } public void reset ( ) throws XNIException { } public void startGeneralEntity ( String name , XMLResourceIdentifier identifier , 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 { <START_BUG> if ( ! ( fIncludeComments ) ) { <END_BUG> return ; } if ( ! ( fDeferNodeExpansion ) ) { Comment comment = fDocument . createComment ( text . toString ( ) ) ; fCurrentNode . appendChild ( comment ) ; } else { int comment = fDeferredDocumentImpl . createDeferredComment ( text . toString ( ) ) ; fDeferredDocumentImpl . appendChild ( fCurrentNodeIndex , comment ) ; } } public void processingInstruction ( String target , XMLString data , Augmentations augs ) throws XNIException { } 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 startElement ( 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 endGeneralEntity ( String name , Augmentations augs ) throws XNIException { } public void startDTD ( XMLLocator locator , Augmentations augs ) throws XNIException { } public void endDTD ( Augmentations augs ) throws XNIException { } public void startExternalSubset ( Augmentations augs ) throws XNIException { } public void endExternalSubset ( Augmentations augs ) throws XNIException { } public void internalEntityDecl ( String name , XMLString text , XMLString nonNormalizedText , Augmentations augs ) throws XNIException { } public void externalEntityDecl ( String name , XMLResourceIdentifier identifier , Augmentations augs ) throws XNIException { } public void unparsedEntityDecl ( String name , XMLResourceIdentifier identifier , String notation , Augmentations augs ) throws XNIException { } public void notationDecl ( String name , XMLResourceIdentifier identifier , Augmentations augs ) throws XNIException { } public void elementDecl ( String name , String contentModel , Augmentations augs ) throws XNIException { } public void attributeDecl ( String elementName , String attributeName , String type , String [ ] enumeration , String defaultType , XMLString defaultValue , XMLString nonNormalizedDefaultValue , Augmentations augs ) throws XNIException { } protected Element createElementNode ( QName element ) { } protected Attr createAttrNode ( QName attrQName ) { } }

Fix:
if ( ( ! ( fIncludeComments ) ) || ( fInDTD ) ) {