Buggy code:
public abstract class AbstractStringValidator extends AbstractDatatypeValidator { protected int fLength = 0 ; protected int fMaxLength = Integer . MAX_VALUE ; protected int fMinLength = 0 ; protected Vector fEnumeration = null ; public static final String FACET_SPECIAL_TOKEN = "specialToken" ; public static final String SPECIAL_TOKEN_NONE = "NONE" ; public static final String SPECIAL_TOKEN_NMTOKEN = "NMTOKEN" ; public static final String SPECIAL_TOKEN_NAME = "Name" ; public static final String SPECIAL_TOKEN_IDNAME = "ID" ; public static final String SPECIAL_TOKEN_IDREFNAME = "IDREF" ; public static final String SPECIAL_TOKEN_NCNAME = "NCName" ; public static final String SPECIAL_TOKEN_IDNCNAME = "ID" ; public static final String SPECIAL_TOKEN_IDREFNCNAME = "IDREF" ; public static final String SPECIAL_TOKEN_ENTITY = "ENTITY" ; protected String fTokenType = AbstractStringValidator . SPECIAL_TOKEN_NONE ; public AbstractStringValidator ( ) throws InvalidDatatypeFacetException { } public AbstractStringValidator ( DatatypeValidator base , Hashtable facets , boolean derivedByList ) throws InvalidDatatypeFacetException { } protected abstract void assignAdditionalFacets ( String key , Hashtable facets ) throws InvalidDatatypeFacetException { } protected void inheritAdditionalFacets ( ) { } protected void checkBaseFacetConstraints ( ) throws InvalidDatatypeFacetException { } protected boolean derivationList ( boolean derivedByList ) { } public Object validate ( String content , Object state ) throws InvalidDatatypeValueException { } private void checkContent ( String content , Object state , boolean asBase ) throws InvalidDatatypeValueException { <START_BUG> if ( ( this . fBaseValidator ) != null ) { <END_BUG> ( ( AbstractStringValidator ) ( fBaseValidator ) ) . checkContent ( content , state , true ) ; } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_PATTERN ) ) != 0 ) { if ( ( ( fRegex ) == null ) || ( ( fRegex . matches ( content ) ) == false ) ) throw new InvalidDatatypeValueException ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>regular<seq2seq4repair_space>expression<seq2seq4repair_space>facet<seq2seq4repair_space>'" ) + ( fPattern ) ) + "'." ) ) ; } if ( ( fTokenType ) != ( AbstractStringValidator . SPECIAL_TOKEN_NONE ) ) { AbstractStringValidator . validateToken ( fTokenType , content ) ; } if ( asBase ) return ; checkValueSpace ( content ) ; int length = getLength ( content ) ; if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_MAXLENGTH ) ) != 0 ) { if ( length > ( fMaxLength ) ) { throw new InvalidDatatypeValueException ( ( ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>with<seq2seq4repair_space>length<seq2seq4repair_space>'" ) + length ) + "'<seq2seq4repair_space>exceeds<seq2seq4repair_space>maximum<seq2seq4repair_space>length<seq2seq4repair_space>facet<seq2seq4repair_space>of<seq2seq4repair_space>'" ) + ( fMaxLength ) ) + "'." ) ) ; } } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_MINLENGTH ) ) != 0 ) { if ( length < ( fMinLength ) ) { throw new InvalidDatatypeValueException ( ( ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>with<seq2seq4repair_space>length<seq2seq4repair_space>'" ) + length ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>minimum<seq2seq4repair_space>length<seq2seq4repair_space>facet<seq2seq4repair_space>of<seq2seq4repair_space>'" ) + ( fMinLength ) ) + "'." ) ) ; } } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_LENGTH ) ) != 0 ) { if ( length != ( fLength ) ) { throw new InvalidDatatypeValueException ( ( ( ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>with<seq2seq4repair_space>length<seq2seq4repair_space>'" ) + length ) + "'<seq2seq4repair_space>is<seq2seq4repair_space>not<seq2seq4repair_space>equal<seq2seq4repair_space>to<seq2seq4repair_space>length<seq2seq4repair_space>facet<seq2seq4repair_space>'" ) + ( fLength ) ) + "'." ) ) ; } } if ( ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_ENUMERATION ) ) != 0 ) && ( ( fEnumeration ) != null ) ) { if ( ( fEnumeration . contains ( content ) ) == false ) throw new InvalidDatatypeValueException ( ( ( ( "Value<seq2seq4repair_space>'" + content ) + "'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>one<seq2seq4repair_space>of<seq2seq4repair_space>" ) + ( fEnumeration ) ) ) ; } } protected int getLength ( String content ) { } protected void checkValueSpace ( String content ) throws InvalidDatatypeValueException { } public Object clone ( ) throws CloneNotSupportedException { } public void setTokenType ( String tokenType ) { } protected static void validateToken ( String tokenType , String content ) throws InvalidDatatypeValueException { } }

Fix:
if ( ( fBaseValidator ) instanceof AbstractStringValidator ) {