Buggy code:
abstract class XSDAbstractTraverser { protected static final String NO_NAME = "(no<seq2seq4repair_space>name)" ; protected static final int NOT_ALL_CONTEXT = 0 ; protected static final int PROCESSING_ALL_EL = 1 ; protected static final int GROUP_REF_WITH_ALL = 2 ; protected static final int CHILD_OF_GROUP = 4 ; protected static final int PROCESSING_ALL_GP = 8 ; protected XSDHandler fSchemaHandler = null ; protected SymbolTable fSymbolTable = null ; protected XSAttributeChecker fAttrChecker = null ; protected boolean fValidateAnnotations = false ; ValidationState fValidationState = new ValidationState ( ) ; XSDAbstractTraverser ( XSDHandler handler , XSAttributeChecker attrChecker ) { } void reset ( SymbolTable symbolTable , boolean validateAnnotations , Locale locale ) { } XSAnnotationImpl traverseAnnotationDecl ( Element annotationDecl , Object [ ] parentAttrs , boolean isGlobal , XSDocumentInfo schemaDoc ) { Object [ ] attrValues = fAttrChecker . checkAttributes ( annotationDecl , isGlobal , schemaDoc ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; String contents = DOMUtil . getAnnotation ( annotationDecl ) ; Element child = DOMUtil . getFirstChildElement ( annotationDecl ) ; if ( child != null ) { do { String name = DOMUtil . getLocalName ( child ) ; if ( ! ( ( name . equals ( ELT_APPINFO ) ) || ( name . equals ( ELT_DOCUMENTATION ) ) ) ) { reportSchemaError ( "src-annotation" , new Object [ ] { name } , child ) ; } else { attrValues = fAttrChecker . checkAttributes ( child , true , schemaDoc ) ; fAttrChecker . returnAttrArray ( attrValues , schemaDoc ) ; } child = DOMUtil . getNextSiblingElement ( child ) ; } while ( child != null ) ; } if ( contents == null ) return null ; SchemaGrammar grammar = fSchemaHandler . getGrammar ( schemaDoc . fTargetNamespace ) ; Vector annotationLocalAttrs = ( ( Vector ) ( parentAttrs [ XSAttributeChecker . ATTIDX_NONSCHEMA ] ) ) ; if ( ( annotationLocalAttrs != null ) && ( ! ( annotationLocalAttrs . isEmpty ( ) ) ) ) { StringBuffer localStrBuffer = new StringBuffer ( 64 ) ; localStrBuffer . append ( "<seq2seq4repair_space>" ) ; int i = 0 ; while ( i < ( annotationLocalAttrs . size ( ) ) ) { String rawname = ( ( String ) ( annotationLocalAttrs . elementAt ( ( i ++ ) ) ) ) ; int colonIndex = rawname . indexOf ( ':' ) ; String prefix ; String localpart ; if ( colonIndex == ( - 1 ) ) { prefix = "" ; localpart = rawname ; } else { prefix = rawname . substring ( 0 , colonIndex ) ; localpart = rawname . substring ( ( colonIndex + 1 ) ) ; } String uri = schemaDoc . fNamespaceSupport . getURI ( fSymbolTable . addSymbol ( prefix ) ) ; <START_BUG> if ( ! ( annotationDecl . getAttributeNS ( uri , localpart ) . equals ( "" ) ) ) { <END_BUG> i ++ ; continue ; } localStrBuffer . append ( rawname ) . append ( "=\"" ) ; String value = ( ( String ) ( annotationLocalAttrs . elementAt ( ( i ++ ) ) ) ) ; value = XSDAbstractTraverser . processAttValue ( value ) ; localStrBuffer . append ( value ) . append ( "\"<seq2seq4repair_space>" ) ; } StringBuffer contentBuffer = new StringBuffer ( ( ( contents . length ( ) ) + ( localStrBuffer . length ( ) ) ) ) ; int annotationTokenEnd = contents . indexOf ( ELT_ANNOTATION ) ; if ( annotationTokenEnd == ( - 1 ) ) return null ; annotationTokenEnd += ELT_ANNOTATION . length ( ) ; contentBuffer . append ( contents . substring ( 0 , annotationTokenEnd ) ) ; contentBuffer . append ( localStrBuffer . toString ( ) ) ; contentBuffer . append ( contents . substring ( annotationTokenEnd , contents . length ( ) ) ) ; final String annotation = contentBuffer . toString ( ) ; if ( fValidateAnnotations ) { schemaDoc . addAnnotation ( new XSAnnotationInfo ( annotation , annotationDecl ) ) ; } return new XSAnnotationImpl ( annotation , grammar ) ; } else { if ( fValidateAnnotations ) { schemaDoc . addAnnotation ( new XSAnnotationInfo ( contents , annotationDecl ) ) ; } return new XSAnnotationImpl ( contents , grammar ) ; } } XSAnnotationImpl traverseSyntheticAnnotation ( Element annotationParent , String initialContent , Object [ ] parentAttrs , boolean isGlobal , XSDocumentInfo schemaDoc ) { } private static final XSSimpleType fQNameDV = ( ( XSSimpleType ) ( SG_SchemaNS . getGlobalTypeDecl ( ATTVAL_QNAME ) ) ) ; private StringBuffer fPattern = new StringBuffer ( ) ; private final XSFacets xsFacets = new XSFacets ( ) ; static final class FacetInfo { final XSFacets facetdata ; final Element nodeAfterFacets ; final short fPresentFacets ; final short fFixedFacets ; FacetInfo ( XSFacets facets , Element nodeAfterFacets , short presentFacets , short fixedFacets ) { } } XSDAbstractTraverser . FacetInfo traverseFacets ( Element content , XSSimpleType baseValidator , XSDocumentInfo schemaDoc ) { } private boolean containsQName ( XSSimpleType type ) { } Element traverseAttrsAndAttrGrps ( Element firstAttr , XSAttributeGroupDecl attrGrp , XSDocumentInfo schemaDoc , SchemaGrammar grammar , XSComplexTypeDecl enclosingCT ) { } void reportSchemaError ( String key , Object [ ] args , Element ele ) { } void checkNotationType ( String refName , XSTypeDefinition typeDecl , Element elem ) { } protected XSParticleDecl checkOccurrences ( XSParticleDecl particle , String particleName , Element parent , int allContextFlags , long defaultVals ) { } private static String processAttValue ( String original ) { } private static String escapeAttValue ( String original , int from ) { } }

Fix:
if ( ( annotationDecl . getAttributeNS ( uri , localpart ) . length ( ) ) != 0 ) {