Buggy code:
if ( ( abstractAtt != null ) && ( abstractAtt . booleanValue ( ) ) ) element . setIsAbstract ( ) ; if ( fixedAtt != null ) { element . fDefault = new ValidatedInfo ( ) ; element . fDefault . normalizedValue = fixedAtt ; element . setConstraintType ( FIXED_VALUE ) ; } else if ( defaultAtt != null ) { element . fDefault = new ValidatedInfo ( ) ; element . fDefault . normalizedValue = 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 = SchemaGrammar . fAnyType ; } 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 ) ) ) ) { if ( ( childName . equals ( ELT_KEY ) ) || ( childName . equals ( ELT_UNIQUE ) ) ) { fUniqueOrKeyTraverser . traverse ( child , element , schemaDoc , grammar ) ; if ( ( DOMUtil . getAttrValue ( child , ATT_NAME ) . length ( ) ) != 0 ) { fSchemaHandler . checkForDuplicateNames ( ( ( schemaDoc . fTargetNamespace ) == null ? "," + ( DOMUtil . getAttrValue ( child , ATT_NAME ) ) : ( ( schemaDoc . fTargetNamespace ) + "," ) + ( DOMUtil . getAttrValue ( child , ATT_NAME ) ) ) , fSchemaHandler . getIDRegistry ( ) , child , schemaDoc ) ; } } else if ( childName . equals ( ELT_KEYREF ) ) { fSchemaHandler . storeKeyRef ( child , schemaDoc , element ) ; } child = DOMUtil . getNextSiblingElement ( child ) ; if ( child != null ) { childName = DOMUtil . getLocalName ( child ) ; } } } if ( isGlobal && ( nameAtt != null ) ) grammar . addGlobalElementDecl ( element ) ; if ( nameAtt == null ) { if ( isGlobal ) <START_BUG> reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { NO_NAME , SchemaSymbols . ATT_NAME } ) ; <END_BUG> else reportSchemaError ( "src-element.2.1" , null ) ; nameAtt = NO_NAME ; } if ( child != null ) { reportSchemaError ( "s4s-elt-must-match" , new Object [ ] { nameAtt , "(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 ) ) { reportSchemaError ( "src-element.1" , new Object [ ] { nameAtt } ) ; } if ( haveAnonType && ( typeAtt != null ) ) { reportSchemaError ( "src-element.3" , new Object [ ] { nameAtt } ) ; } checkNotationType ( nameAtt , elementType ) ; if ( ( element . fDefault ) != null ) { fValidationState . setNamespaceSupport ( schemaDoc . fNamespaceSupport ) ; XSConstraints . ElementDefaultValidImmediate ( element . fType , element . fDefault . normalizedValue , fValidationState , element . fDefault ) ; if ( ( element . fDefault . actualValue ) == null ) { reportSchemaError ( "e-props-correct.2" , new Object [ ] { nameAtt , element . fDefault . normalizedValue } ) ; element . setConstraintType ( NO_CONSTRAINT ) ; } } if ( ( element . fSubGroup ) != null ) { if ( ! ( XSConstraints . checkTypeDerivationOk ( element . fType , element . fSubGroup . fType , element . fSubGroup . fFinal ) ) ) { reportSchemaError ( "e-props-correct.3" , new Object [ ] { nameAtt , ( ( subGroupAtt . prefix ) + ":" ) + ( subGroupAtt . localpart ) } ) ; } } if ( ( element . fDefault ) != null ) { if ( ( ( ( elementType . getXSType ( ) ) == ( XSTypeDecl . SIMPLE_TYPE ) ) && ( ( ( org . apache . xerces . impl . dv . XSSimpleType ) ( elementType ) ) . isIDType ( ) ) ) || ( ( ( elementType . getXSType ( ) ) == ( XSTypeDecl . COMPLEX_TYPE ) ) && ( ( ( org . apache . xerces . impl . xs . XSComplexTypeDecl ) ( elementType ) ) . containsTypeID ( ) ) ) ) { reportSchemaError ( "e-props-correct.4" , new Object [ ] { element . fName }

Fix:
reportSchemaError ( "s4s-att-must-appear" , new Object [ ] { SchemaSymbols . ELT_ELEMENT , SchemaSymbols . ATT_NAME } ) ;