Buggy code:
public class XSConstraints { static final int OCCURRENCE_UNKNOWN = ( SchemaSymbols . OCCURRENCE_UNBOUNDED ) - 1 ; static final XSSimpleType STRING_TYPE = ( ( XSSimpleType ) ( SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_STRING ) ) ) ; public static boolean checkTypeDerivationOk ( XSTypeDecl derived , XSTypeDecl base , short block ) { } public static boolean checkSimpleDerivationOk ( XSSimpleType derived , XSTypeDecl base , short block ) { } public static boolean checkComplexDerivationOk ( XSComplexTypeDecl derived , XSTypeDecl base , short block ) { } private static boolean checkSimpleDerivation ( XSSimpleType derived , XSSimpleType base , short block ) { } private static boolean checkComplexDerivation ( XSComplexTypeDecl derived , XSTypeDecl base , short block ) { } public static Object ElementDefaultValidImmediate ( XSTypeDecl type , Object value , ValidationContext context , ValidatedInfo vinfo ) { XSSimpleType dv = null ; if ( ( type . getTypeCategory ( ) ) == ( XSTypeDecl . SIMPLE_TYPE ) ) { dv = ( ( XSSimpleType ) ( type ) ) ; } else { XSComplexTypeDecl ctype = ( ( XSComplexTypeDecl ) ( type ) ) ; if ( ( ctype . fContentType ) == ( XSComplexTypeDecl . CONTENTTYPE_SIMPLE ) ) { dv = ctype . fXSSimpleType ; } else if ( ( ctype . fContentType ) == ( XSComplexTypeDecl . CONTENTTYPE_MIXED ) ) { <START_BUG> if ( ! ( ctype . fParticle . emptiable ( ) ) ) <END_BUG> return null ; } else { return null ; } } Object actualValue = null ; if ( dv == null ) { dv = XSConstraints . STRING_TYPE ; } try { if ( value instanceof String ) { actualValue = dv . validate ( ( ( String ) ( value ) ) , context , vinfo ) ; } else { ValidatedInfo info = ( ( ValidatedInfo ) ( value ) ) ; dv . validate ( context , info ) ; actualValue = info . actualValue ; } } catch ( InvalidDatatypeValueException ide ) { return null ; } return actualValue ; } static void reportSchemaError ( XMLErrorReporter errorReporter , SimpleLocator loc , String key , Object [ ] args ) { } public static void fullSchemaChecking ( XSGrammarBucket grammarBucket , SubstitutionGroupHandler SGHandler , CMBuilder cmBuilder , XMLErrorReporter errorReporter ) { } public static void checkElementDeclsConsistent ( XSComplexTypeDecl type , XSParticleDecl particle , SymbolHash elemDeclHash , SubstitutionGroupHandler sgHandler ) throws XMLSchemaException { } public static void findElemInTable ( XSComplexTypeDecl type , XSElementDecl elem , SymbolHash elemDeclHash ) throws XMLSchemaException { } private static void particleValidRestriction ( XSParticleDecl dParticle , SubstitutionGroupHandler dSGHandler , XSParticleDecl bParticle , SubstitutionGroupHandler bSGHandler ) throws XMLSchemaException { } private static void particleValidRestriction ( XSParticleDecl dParticle , SubstitutionGroupHandler dSGHandler , XSParticleDecl bParticle , SubstitutionGroupHandler bSGHandler , boolean checkWCOccurrence ) throws XMLSchemaException { } private static void addElementToParticleVector ( Vector v , XSElementDecl d ) { } private static XSParticleDecl getNonUnaryGroup ( XSParticleDecl p ) { } private static Vector removePointlessChildren ( XSParticleDecl p ) { } private static void gatherChildren ( int parentType , XSParticleDecl p , Vector children ) { } private static void checkNameAndTypeOK ( XSElementDecl dElement , int dMin , int dMax , XSElementDecl bElement , int bMin , int bMax ) throws XMLSchemaException { } private static void checkIDConstraintRestriction ( XSElementDecl derivedElemDecl , XSElementDecl baseElemDecl ) throws XMLSchemaException { } private static boolean checkOccurrenceRange ( int min1 , int max1 , int min2 , int max2 ) { } private static void checkNSCompat ( XSElementDecl elem , int min1 , int max1 , XSWildcardDecl wildcard , int min2 , int max2 , boolean checkWCOccurrence ) throws XMLSchemaException { } private static void checkNSSubset ( XSWildcardDecl dWildcard , int min1 , int max1 , XSWildcardDecl bWildcard , int min2 , int max2 ) throws XMLSchemaException { } private static void checkNSRecurseCheckCardinality ( Vector children , int min1 , int max1 , SubstitutionGroupHandler dSGHandler , XSParticleDecl wildcard , int min2 , int max2 , boolean checkWCOccurrence ) throws XMLSchemaException { } private static void checkRecurse ( Vector dChildren , int min1 , int max1 , SubstitutionGroupHandler dSGHandler , Vector bChildren , int min2 , int max2 , SubstitutionGroupHandler bSGHandler ) throws XMLSchemaException { } private static void checkRecurseUnordered ( Vector dChildren , int min1 , int max1 , SubstitutionGroupHandler dSGHandler , Vector bChildren , int min2 , int max2 , SubstitutionGroupHandler bSGHandler ) throws XMLSchemaException { } private static void checkRecurseLax ( Vector dChildren , int min1 , int max1 , SubstitutionGroupHandler dSGHandler , Vector bChildren , int min2 , int max2 , SubstitutionGroupHandler bSGHandler ) throws XMLSchemaException { } private static void checkMapAndSum ( Vector dChildren , int min1 , int max1 , SubstitutionGroupHandler dSGHandler , Vector bChildren , int min2 , int max2 , SubstitutionGroupHandler bSGHandler ) throws XMLSchemaException { } public static boolean overlapUPA ( XSElementDecl element1 , XSElementDecl element2 , SubstitutionGroupHandler sgHandler ) { } public static boolean overlapUPA ( XSElementDecl element , XSWildcardDecl wildcard , SubstitutionGroupHandler sgHandler ) { } public static boolean overlapUPA ( XSWildcardDecl wildcard1 , XSWildcardDecl wildcard2 ) { } public static boolean overlapUPA ( Object decl1 , Object decl2 , SubstitutionGroupHandler sgHandler ) { } }

Fix:
if ( ! ( ( ( XSParticleDecl ) ( ctype . getParticle ( ) ) ) . emptiable ( ) ) )