Buggy code:
public class DecimalDatatypeValidator extends AbstractNumericValidator { protected int fTotalDigits ; protected int fFractionDigits ; public DecimalDatatypeValidator ( ) { } public DecimalDatatypeValidator ( DatatypeValidator base , Hashtable facets , boolean derivedByList , XMLErrorReporter reporter ) { } public int compare ( String value1 , String value2 ) { } protected void inheritAdditionalFacets ( ) { } protected void checkFacetConstraints ( ) throws InvalidDatatypeFacetException { } protected void checkBaseFacetConstraints ( ) throws InvalidDatatypeFacetException { } protected void assignAdditionalFacets ( String key , Hashtable facets ) throws InvalidDatatypeFacetException { } protected int compareValues ( Object value1 , Object value2 ) { } protected void setMaxInclusive ( String value ) { } protected void setMinInclusive ( String value ) { } protected void setMaxExclusive ( String value ) { } protected void setMinExclusive ( String value ) { } protected void setEnumeration ( Vector enumeration ) throws InvalidDatatypeValueException { } protected String getMaxInclusive ( boolean isBase ) { } protected String getMinInclusive ( boolean isBase ) { } protected String getMaxExclusive ( boolean isBase ) { } protected String getMinExclusive ( boolean isBase ) { } protected void checkContent ( String content , Object state , Vector enumeration , boolean asBase ) throws InvalidDatatypeValueException { if ( ( fBaseValidator ) instanceof DecimalDatatypeValidator ) { ( ( DecimalDatatypeValidator ) ( fBaseValidator ) ) . checkContent ( content , state , enumeration , true ) ; } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_PATTERN ) ) != 0 ) { <START_BUG> if ( ( ( fRegex ) == null ) || ( ( fRegex . matches ( content ) ) == false ) ) <END_BUG> throw new InvalidDatatypeValueException ( ( ( ( "Value'" + content ) + "'<seq2seq4repair_space>does<seq2seq4repair_space>not<seq2seq4repair_space>match<seq2seq4repair_space>regular<seq2seq4repair_space>expression<seq2seq4repair_space>facet<seq2seq4repair_space>" ) + ( fRegex . getPattern ( ) ) ) ) ; } if ( asBase ) return ; BigDecimal d = null ; try { d = new BigDecimal ( DecimalDatatypeValidator . stripPlusIfPresent ( content ) ) ; } catch ( Exception nfe ) { String msg = getErrorString ( DatatypeMessageProvider . fgMessageKeys [ DatatypeMessageProvider . NOT_DECIMAL ] , new Object [ ] { ( "'" + content ) + "'" } ) ; throw new InvalidDatatypeValueException ( msg ) ; } if ( enumeration != null ) { int size = enumeration . size ( ) ; BigDecimal [ ] enumDecimal = new BigDecimal [ size ] ; int i = 0 ; try { for ( ; i < size ; i ++ ) enumDecimal [ i ] = new BigDecimal ( DecimalDatatypeValidator . stripPlusIfPresent ( ( ( String ) ( enumeration . elementAt ( i ) ) ) ) ) ; } catch ( NumberFormatException nfe ) { String msg = getErrorString ( DatatypeMessageProvider . fgMessageKeys [ DatatypeMessageProvider . INVALID_ENUM_VALUE ] , new Object [ ] { enumeration . elementAt ( i ) } ) ; throw new InvalidDatatypeValueException ( msg ) ; } enumCheck ( d , enumDecimal ) ; } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_FRACTIONDIGITS ) ) != 0 ) { if ( ( d . scale ( ) ) > ( fFractionDigits ) ) { String msg = getErrorString ( DatatypeMessageProvider . fgMessageKeys [ DatatypeMessageProvider . FRACTION_EXCEEDED ] , new Object [ ] { ( ( ( ( "'" + content ) + "'" ) + "<seq2seq4repair_space>with<seq2seq4repair_space>fractionDigits<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + ( d . scale ( ) ) ) + "'" , ( "'" + ( fFractionDigits ) ) + "'" } ) ; throw new InvalidDatatypeValueException ( msg ) ; } } if ( ( ( fFacetsDefined ) & ( DatatypeValidator . FACET_TOTALDIGITS ) ) != 0 ) { int totalDigits = ( d . movePointRight ( d . scale ( ) ) . toString ( ) . length ( ) ) - ( ( d . signum ( ) ) < 0 ? 1 : 0 ) ; if ( totalDigits > ( fTotalDigits ) ) { String msg = getErrorString ( DatatypeMessageProvider . fgMessageKeys [ DatatypeMessageProvider . TOTALDIGITS_EXCEEDED ] , new Object [ ] { ( ( ( ( "'" + content ) + "'" ) + "<seq2seq4repair_space>with<seq2seq4repair_space>totalDigits<seq2seq4repair_space>=<seq2seq4repair_space>'" ) + totalDigits ) + "'" , ( "'" + ( fTotalDigits ) ) + "'" } ) ; throw new InvalidDatatypeValueException ( msg ) ; } } boundsCheck ( d ) ; if ( ( fEnumeration ) != null ) enumCheck ( d , ( ( BigDecimal [ ] ) ( fEnumeration ) ) ) ; return ; } private static String stripPlusIfPresent ( String value ) { } private void enumCheck ( BigDecimal v ) { } }

Fix:
if ( ( ( fRegex ) == null ) || ( ! ( fRegex . matches ( content ) ) ) )