Buggy code:
protected ValidationManager fValidationManager = null ; protected ValidationState fValidationState = new ValidationState ( ) ; protected boolean fNamespaces ; protected boolean fValidation ; protected boolean fDTDValidation ; protected boolean fDynamicValidation ; protected boolean fWarnDuplicateAttdef ; protected SymbolTable fSymbolTable ; protected XMLErrorReporter fErrorReporter ; protected XMLGrammarPool fGrammarPool ; protected DTDGrammarBucket fGrammarBucket ; protected XMLLocator fDocLocation ; protected NamespaceContext fNamespaceContext = null ; protected DTDDVFactory fDatatypeValidatorFactory ; protected XMLDocumentHandler fDocumentHandler ; protected XMLDocumentSource fDocumentSource ; protected DTDGrammar fDTDGrammar ; protected boolean fSeenDoctypeDecl = false ; private boolean fPerformValidation ; private String fSchemaType ; private final QName fCurrentElement = new QName ( ) ; private int fCurrentElementIndex = - 1 ; private int fCurrentContentSpecType = - 1 ; private final QName fRootElement = new QName ( ) ; private boolean fInCDATASection = false ; private int [ ] fElementIndexStack = new int [ 8 ] ; private int [ ] fContentSpecTypeStack = new int [ 8 ] ; private QName [ ] fElementQNamePartsStack = new QName [ 8 ] ; private QName [ ] fElementChildren = new QName [ 32 ] ; private int fElementChildrenLength = 0 ; private int [ ] fElementChildrenOffsetStack = new int [ 32 ] ; private int fElementDepth = - 1 ; private boolean fSeenRootElement = false ; private boolean fInElementContent = false ; private XMLElementDecl fTempElementDecl = new XMLElementDecl ( ) ; private XMLAttributeDecl fTempAttDecl = new XMLAttributeDecl ( ) ; private XMLEntityDecl fEntityDecl = new XMLEntityDecl ( ) ; private QName fTempQName = new QName ( ) ; private StringBuffer fBuffer = new StringBuffer ( ) ; protected DatatypeValidator fValID ; protected DatatypeValidator fValIDRef ; protected DatatypeValidator fValIDRefs ; protected DatatypeValidator fValENTITY ; protected DatatypeValidator fValENTITIES ; protected DatatypeValidator fValNMTOKEN ; protected DatatypeValidator fValNMTOKENS ; protected DatatypeValidator fValNOTATION ; public XMLDTDValidator ( ) { } DTDGrammarBucket getGrammarBucket ( ) { } 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 Boolean getFeatureDefault ( String featureId ) { } public Object getPropertyDefault ( String propertyId ) { } public void setDocumentHandler ( XMLDocumentHandler documentHandler ) { } public XMLDocumentHandler getDocumentHandler ( ) { } public void setDocumentSource ( XMLDocumentSource source ) { } public XMLDocumentSource getDocumentSource ( ) { } public void startDocument ( XMLLocator locator , String encoding , NamespaceContext namespaceContext , 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 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 startCDATA ( Augmentations augs ) throws XNIException { } public void endCDATA ( Augmentations augs ) throws XNIException { } public void endDocument ( 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 startGeneralEntity ( String name , XMLResourceIdentifier identifier , String encoding , Augmentations augs ) throws XNIException { } public void endGeneralEntity ( String name , Augmentations augs ) throws XNIException { } public void textDecl ( String version , String encoding , Augmentations augs ) throws XNIException { } public final boolean hasGrammar ( ) { } public final boolean validate ( ) { } protected void addDTDDefaultAttrsAndValidate ( QName elementName , int elementIndex , XMLAttributes attributes ) throws XNIException { } protected String getExternalEntityRefInAttrValue ( String nonNormalizedValue ) { } protected void validateDTDattribute ( QName element , String attValue , XMLAttributeDecl attributeDecl ) throws XNIException { } protected boolean invalidStandaloneAttDef ( QName element , QName attribute ) { } private boolean normalizeAttrValue ( XMLAttributes attributes , int index ) { } private final void rootElementSpecified ( QName rootElement ) throws XNIException { } private int checkContent ( int elementIndex , QName [ ] children , int childOffset , int childCount ) throws XNIException { } private int getContentSpecType ( int elementIndex ) { } private void charDataInContent ( ) { } private String getAttributeTypeName ( XMLAttributeDecl attrDecl ) { } protected void init ( ) { <START_BUG> if ( fValidation ) { <END_BUG> try { fValID = fDatatypeValidatorFactory . getBuiltInDV ( fIDSymbol ) ; fValIDRef = fDatatypeValidatorFactory . getBuiltInDV ( fIDREFSymbol ) ; fValIDRefs = fDatatypeValidatorFactory . getBuiltInDV ( fIDREFSSymbol ) ; fValENTITY = fDatatypeValidatorFactory . getBuiltInDV ( fENTITYSymbol ) ; fValENTITIES = fDatatypeValidatorFactory . getBuiltInDV ( fENTITIESSymbol ) ; fValNMTOKEN = fDatatypeValidatorFactory . getBuiltInDV ( fNMTOKENSymbol ) ; fValNMTOKENS = fDatatypeValidatorFactory . getBuiltInDV ( fNMTOKENSSymbol ) ; fValNOTATION = fDatatypeValidatorFactory . getBuiltInDV ( fNOTATIONSymbol ) ; } catch ( Exception e ) { e . printStackTrace ( System . err ) ; } } } private void ensureStackCapacity ( int newElementDepth ) { } protected boolean handleStartElement ( QName element , XMLAttributes attributes , Augmentations augs ) throws XNIException { } protected void startNamespaceScope ( QName element , XMLAttributes attributes , Augmentations augs ) { } protected void handleEndElement ( QName element , Augmentations augs , boolean isEmpty ) throws XNIException { } protected void endNamespaceScope ( QName element , Augmentations augs , boolean isEmpty ) { } protected boolean isSpace ( int c ) { } }

Fix:
if ( ( fValidation ) || ( fDynamicValidation ) ) {