Buggy code:
private boolean [ ] fSawChildrenStack = new boolean [ XMLSchemaValidator . INITIAL_STACK_SIZE ] ; private final QName fTempQName = new QName ( ) ; private ValidatedInfo fValidatedInfo = new ValidatedInfo ( ) ; private ValidationState fState4XsiType = new ValidationState ( ) ; private ValidationState fState4ApplyDefault = new ValidationState ( ) ; protected XMLSchemaValidator . XPathMatcherStack fMatcherStack = new XMLSchemaValidator . XPathMatcherStack ( ) ; protected XMLSchemaValidator . ValueStoreCache fValueStoreCache = new XMLSchemaValidator . ValueStoreCache ( ) ; public XMLSchemaValidator ( ) { } public void reset ( XMLComponentManager componentManager ) throws XMLConfigurationException { } public void startValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) { } public XPathMatcher activateField ( Field field , int initialDepth ) { } public void endValueScopeFor ( IdentityConstraint identityConstraint , int initialDepth ) { } public void setMayMatch ( Field field , Boolean state ) { } public Boolean mayMatch ( Field field ) { } private void activateSelectorFor ( IdentityConstraint ic ) { } void ensureStackCapacity ( ) { } void handleStartDocument ( XMLLocator locator , String encoding ) { } void handleEndDocument ( ) { } XMLString handleCharacters ( XMLString text ) { } private void normalizeWhitespace ( XMLString value , boolean collapse ) { } private void normalizeWhitespace ( String value , boolean collapse ) { } void handleIgnorableWhitespace ( XMLString text ) { } Augmentations handleStartElement ( QName element , XMLAttributes attributes , Augmentations augs ) { } Augmentations handleEndElement ( QName element , Augmentations augs ) { } final Augmentations endElementPSVI ( boolean root , SchemaGrammar [ ] grammars , Augmentations augs ) { } Augmentations getEmptyAugs ( Augmentations augs ) { } void storeLocations ( String sLocation , String nsLocation ) { } SchemaGrammar findSchemaGrammar ( short contextType , String namespace , QName enclosingElement , QName triggeringComponet , XMLAttributes attributes ) { } XSTypeDefinition getAndCheckXsiType ( QName element , String xsiType , XMLAttributes attributes ) { } boolean getXsiNil ( QName element , String xsiNil ) { } void processAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processOneAttribute ( QName element , XMLAttributes attributes , int index , XSAttributeDecl currDecl , XSAttributeUseImpl currUse , AttributePSVImpl attrPSVI ) { String attrValue = attributes . getValue ( index ) ; fXSIErrorReporter . pushContext ( ) ; XSSimpleType attDV = currDecl . fType ; Object actualValue = null ; try { actualValue = attDV . validate ( attrValue , fValidationState , fValidatedInfo ) ; if ( fNormalizeData ) attributes . setValue ( index , fValidatedInfo . normalizedValue ) ; if ( attributes instanceof XMLAttributesImpl ) { XMLAttributesImpl attrs = ( ( XMLAttributesImpl ) ( attributes ) ) ; boolean schemaId = ( ( fValidatedInfo . memberType ) != null ) ? fValidatedInfo . memberType . isIDType ( ) : attDV . isIDType ( ) ; attrs . setSchemaId ( index , schemaId ) ; } if ( ( ( attDV . getVariety ( ) ) == ( XSSimpleType . VARIETY_ATOMIC ) ) && ( ( attDV . getPrimitiveKind ( ) ) == ( XSSimpleType . PRIMITIVE_NOTATION ) ) ) { QName qName = ( ( QName ) ( actualValue ) ) ; SchemaGrammar grammar = fGrammarBucket . getGrammar ( qName . uri ) ; if ( grammar != null ) { fNotation = grammar . getGlobalNotationDecl ( qName . localpart ) ; } } } catch ( InvalidDatatypeValueException idve ) { reportSchemaError ( idve . getKey ( ) , idve . getArgs ( ) ) ; reportSchemaError ( "cvc-attribute.3" , new Object [ ] { element . rawname , fTempQName . rawname , attrValue , attDV . getName ( ) } ) ; } if ( ( actualValue != null ) && ( ( currDecl . getConstraintType ( ) ) == ( XSConstants . VC_FIXED ) ) ) { if ( ( ! ( isComparable ( fValidatedInfo , currDecl . fDefault ) ) ) || ( ! ( actualValue . equals ( currDecl . fDefault . actualValue ) ) ) ) { reportSchemaError ( "cvc-attribute.4" , new Object [ ] { element . rawname , fTempQName . rawname , attrValue , currDecl . fDefault . stringValue ( ) } ) ; } } if ( ( ( actualValue != null ) && ( currUse != null ) ) && ( ( currUse . fConstraintType ) == ( XSConstants . VC_FIXED ) ) ) { <START_BUG> if ( ( ! ( isComparable ( fValidatedInfo , currDecl . fDefault ) ) ) || ( ! ( actualValue . equals ( currUse . fDefault . actualValue ) ) ) ) { <END_BUG> reportSchemaError ( "cvc-complex-type.3.1" , new Object [ ] { element . rawname , fTempQName . rawname , attrValue , currUse . fDefault . stringValue ( ) } ) ; } } if ( fIdConstraint ) { attrPSVI . fActualValue = actualValue ; } if ( fAugPSVI ) { attrPSVI . fDeclaration = currDecl ; attrPSVI . fTypeDecl = attDV ; attrPSVI . fMemberType = fValidatedInfo . memberType ; attrPSVI . fNormalizedValue = fValidatedInfo . normalizedValue ; attrPSVI . fActualValue = fValidatedInfo . actualValue ; attrPSVI . fActualValueType = fValidatedInfo . actualValueType ; attrPSVI . fItemValueTypes = fValidatedInfo . itemValueTypes ; attrPSVI . fValidationAttempted = AttributePSVI . VALIDATION_FULL ; String [ ] errors = fXSIErrorReporter . mergeContext ( ) ; attrPSVI . fErrorCodes = errors ; attrPSVI . fValidity = ( errors == null ) ? AttributePSVI . VALIDITY_VALID : AttributePSVI . VALIDITY_INVALID ; } } void addDefaultAttributes ( QName element , XMLAttributes attributes , XSAttributeGroupDecl attrGrp ) { } void processElementContent ( QName element ) { } Object elementLocallyValidType ( QName element , Object textContent ) { } Object elementLocallyValidComplexType ( QName element , Object textContent ) { } void reportSchemaError ( String key , Object [ ] arguments ) { } private boolean isComparable ( ValidatedInfo info1 , ValidatedInfo info2 ) { } private short convertToPrimitiveKind ( short valueType ) { } private String expectedStr ( Vector expected ) { }

Fix:
if ( ( ! ( isComparable ( fValidatedInfo , currUse . fDefault ) ) ) || ( ! ( actualValue . equals ( currUse . fDefault . actualValue ) ) ) ) {