Buggy code:
XInt blockAtt = ( ( XInt ) ( attrValues [ XSAttributeChecker . ATTIDX_BLOCK ] ) ) ; String defaultAtt = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_DEFAULT ] ) ) ; XInt finalAtt = ( ( XInt ) ( attrValues [ XSAttributeChecker . ATTIDX_FINAL ] ) ) ; String fixedAtt = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_FIXED ] ) ) ; XInt formAtt = ( ( XInt ) ( attrValues [ XSAttributeChecker . ATTIDX_FORM ] ) ) ; String nameAtt = ( ( String ) ( attrValues [ XSAttributeChecker . ATTIDX_NAME ] ) ) ; Boolean nillableAtt = ( ( Boolean ) ( attrValues [ XSAttributeChecker . ATTIDX_NILLABLE ] ) ) ; QName subGroupAtt = ( ( QName ) ( attrValues [ XSAttributeChecker . ATTIDX_SUBSGROUP ] ) ) ; QName typeAtt = ( ( QName ) ( attrValues [ XSAttributeChecker . ATTIDX_TYPE ] ) ) ; XSElementDecl element = new XSElementDecl ( ) ; if ( nameAtt != null ) element . fName = fSymbolTable . addSymbol ( nameAtt ) ; if ( isGlobal ) { element . fTargetNamespace = schemaDoc . fTargetNamespace ; } else if ( formAtt != null ) { if ( ( formAtt . intValue ( ) ) == ( SchemaSymbols . FORM_QUALIFIED ) ) element . fTargetNamespace = schemaDoc . fTargetNamespace ; else element . fTargetNamespace = fSchemaHandler . EMPTY_STRING ; } else if ( schemaDoc . fAreLocalElementsQualified ) { element . fTargetNamespace = schemaDoc . fTargetNamespace ; } else { element . fTargetNamespace = fSchemaHandler . EMPTY_STRING ; } element . fBlock = ( blockAtt == null ) ? schemaDoc . fBlockDefault : blockAtt . shortValue ( ) ; element . fFinal = ( finalAtt == null ) ? schemaDoc . fFinalDefault : finalAtt . shortValue ( ) ; if ( nillableAtt . booleanValue ( ) ) element . setIsNillable ( ) ; if ( ( abstractAtt != null ) && ( abstractAtt . booleanValue ( ) ) ) element . setIsAbstract ( ) ; if ( fixedAtt != null ) { element . fDefault = fixedAtt ; <START_BUG> element . setConstraintType ( FIXED_VALUET ) ; <END_BUG> } else if ( defaultAtt != null ) { element . fDefault = defaultAtt ; element . setConstraintType ( DEFAULT_VALUE ) ; } else { element . setConstraintType ( NO_CONSTRAINT ) ; } if ( subGroupAtt != null ) { element . fSubGroup = ( ( XSElementDecl ) ( fSchemaHandler . getGlobalDecl ( schemaDoc , ELEMENT_TYPE , subGroupAtt ) ) ) ; } Element child = DOMUtil . getFirstChildElement ( elmDecl ) ; if ( ( child != null ) && ( DOMUtil . getLocalName ( child ) . equals ( ELT_ANNOTATION ) ) ) { traverseAnnotationDecl ( child , attrValues , false , schemaDoc ) ; child = DOMUtil . getNextSiblingElement ( child ) ; } XSTypeDecl elementType = null ; boolean haveAnonType = false ; if ( child != null ) { String childName = DOMUtil . getLocalName ( child ) ; if ( childName . equals ( ELT_COMPLEXTYPE ) ) { elementType = fComplexTypeTraverser . traverseLocal ( child , schemaDoc , grammar ) ; haveAnonType = true ; child = DOMUtil . getNextSiblingElement ( child ) ; } else if ( childName . equals ( ELT_SIMPLETYPE ) ) { elementType = fSimpleTypeTraverser . traverseLocal ( child , schemaDoc , grammar ) ; haveAnonType = true ; child = DOMUtil . getNextSiblingElement ( child ) ; } } if ( ( elementType == null ) && ( typeAtt != null ) ) { elementType = ( ( XSTypeDecl ) ( fSchemaHandler . getGlobalDecl ( schemaDoc , TYPEDECL_TYPE , typeAtt ) ) ) ; } if ( ( elementType == null ) && ( ( element . fSubGroup ) != null ) ) { elementType = element . fSubGroup . fType ; } if ( elementType == null ) { elementType = ( ( XSTypeDecl ) ( fSchemaHandler . getGlobalDecl ( schemaDoc , fSchemaHandler . TYPEDECL_TYPE , XSDElementTraverser . ANY_TYPE ) ) ) ; } element . fType = elementType ; if ( child != null ) { String childName = DOMUtil . getLocalName ( child ) ; while ( ( child != null ) && ( ( ( childName . equals ( ELT_KEY ) ) || ( childName . equals ( ELT_KEYREF ) ) ) || ( childName . equals ( ELT_UNIQUE ) ) ) ) { child = DOMUtil . getNextSiblingElement ( child ) ; if ( child != null ) { childName = DOMUtil . getLocalName ( child ) ; } } } if ( nameAtt != null ) grammar . addGlobalElementDecl ( element ) ; if ( nameAtt == null ) { if ( isGlobal ) reportGenericSchemaError ( "src-element.0:<seq2seq4repair_space>'name'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>present<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>global<seq2seq4repair_space>element<seq2seq4repair_space>declaration" ) ; else reportGenericSchemaError ( "src-element.2.1:<seq2seq4repair_space>One<seq2seq4repair_space>of<seq2seq4repair_space>'ref'<seq2seq4repair_space>or<seq2seq4repair_space>'name'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>present<seq2seq4repair_space>in<seq2seq4repair_space>a<seq2seq4repair_space>local<seq2seq4repair_space>element<seq2seq4repair_space>declaration" ) ; } if ( child != null ) { reportGenericSchemaError ( "src-element.0:<seq2seq4repair_space>the<seq2seq4repair_space>content<seq2seq4repair_space>of<seq2seq4repair_space>an<seq2seq4repair_space>element<seq2seq4repair_space>information<seq2seq4repair_space>item<seq2seq4repair_space>must<seq2seq4repair_space>match<seq2seq4repair_space>(annotation?,<seq2seq4repair_space>(simpleType<seq2seq4repair_space>|<seq2seq4repair_space>complexType)?,<seq2seq4repair_space>(unique<seq2seq4repair_space>|<seq2seq4repair_space>key<seq2seq4repair_space>|<seq2seq4repair_space>keyref)*))" ) ; } if ( ( defaultAtt != null ) && ( fixedAtt != null ) ) { reportGenericSchemaError ( ( ( "src-element.1:<seq2seq4repair_space>'default'<seq2seq4repair_space>and<seq2seq4repair_space>'fixed'<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>both<seq2seq4repair_space>be<seq2seq4repair_space>present<seq2seq4repair_space>in<seq2seq4repair_space>element<seq2seq4repair_space>declaration<seq2seq4repair_space>'" + nameAtt ) + "'" ) ) ; } if ( haveAnonType && ( typeAtt != null ) ) { reportGenericSchemaError ( ( ( "src-element.3:<seq2seq4repair_space>Element<seq2seq4repair_space>'" + nameAtt ) + "'<seq2seq4repair_space>have<seq2seq4repair_space>both<seq2seq4repair_space>a<seq2seq4repair_space>type<seq2seq4repair_space>attribute<seq2seq4repair_space>and<seq2seq4repair_space>a<seq2seq4repair_space>annoymous<seq2seq4repair_space>type<seq2seq4repair_space>child" ) ) ; } checkNotationType ( nameAtt , elementType ) ; if ( ( element . fDefault ) != null ) { if ( ! ( checkDefaultValid ( element ) ) ) { reportGenericSchemaError ( ( ( ( "e-props-correct.2:<seq2seq4repair_space>invalid<seq2seq4repair_space>fixed<seq2seq4repair_space>or<seq2seq4repair_space>default<seq2seq4repair_space>value<seq2seq4repair_space>'" + defaultAtt ) + "'<seq2seq4repair_space>in<seq2seq4repair_space>element<seq2seq4repair_space>" ) + nameAtt ) ) ; } } if ( ( element . fSubGroup ) != null ) { if ( ! ( fSubGroupHandler . checkSubstitutionGroupOK ( element ) ) ) { reportGenericSchemaError ( ( ( ( ( ( ( "e-props-correct.3:<seq2seq4repair_space>the<seq2seq4repair_space>{type<seq2seq4repair_space>definition}<seq2seq4repair_space>of<seq2seq4repair_space>element<seq2seq4repair_space>'" + nameAtt ) + "'<seq2seq4repair_space>must<seq2seq4repair_space>be<seq2seq4repair_space>validly<seq2seq4repair_space>derived<seq2seq4repair_space>from<seq2seq4repair_space>the<seq2seq4repair_space>{type<seq2seq4repair_space>definition}<seq2seq4repair_space>of<seq2seq4repair_space>the<seq2seq4repair_space>element<seq2seq4repair_space>'" ) + ( subGroupAtt . uri ) ) + "," ) + ( subGroupAtt . localpart ) ) + "'" ) ) ; } } if ( ( element . fDefault ) != null ) { if ( ( elementType instanceof IDDatatypeValidator ) || ( ( elementType instanceof XSComplexTypeDecl ) && ( ( ( XSComplexTypeDecl ) ( elementType ) ) . containsTypeID ( ) ) ) ) { reportGenericSchemaError ( ( "e-props-correct.4:<seq2seq4repair_space>if<seq2seq4repair_space>the<seq2seq4repair_space>{type<seq2seq4repair_space>definition}<seq2seq4repair_space>or<seq2seq4repair_space>{type<seq2seq4repair_space>definition}'s<seq2seq4repair_space>{content<seq2seq4repair_space>type}<seq2seq4repair_space>is<seq2seq4repair_space>or<seq2seq4repair_space>is<seq2seq4repair_space>derived<seq2seq4repair_space>from<seq2seq4repair_space>ID<seq2seq4repair_space>then<seq2seq4repair_space>there<seq2seq4repair_space>must<seq2seq4repair_space>not<seq2seq4repair_space>be<seq2seq4repair_space>a<seq2seq4repair_space>{value<seq2seq4repair_space>constraint}<seq2seq4repair_space>--<seq2seq4repair_space>element<seq2seq4repair_space>"

Fix:
element . setConstraintType ( FIXED_VALUE ) ;