Buggy code:
public class XSComplexTypeDecl implements XSComplexTypeDefinition , TypeInfo { String fName = null ; String fTargetNamespace = null ; XSTypeDefinition fBaseType = null ; short fDerivedBy = XSConstants . DERIVATION_RESTRICTION ; short fFinal = XSConstants . DERIVATION_NONE ; short fBlock = XSConstants . DERIVATION_NONE ; short fMiscFlags = 0 ; XSAttributeGroupDecl fAttrGrp = null ; short fContentType = CONTENTTYPE_EMPTY ; XSSimpleType fXSSimpleType = null ; XSParticleDecl fParticle = null ; XSCMValidator fCMValidator = null ; XSCMValidator fUPACMValidator = null ; XSObjectListImpl fAnnotations = null ; private XSNamespaceItem fNamespaceItem = null ; static final int DERIVATION_ANY = 0 ; static final int DERIVATION_RESTRICTION = 1 ; static final int DERIVATION_EXTENSION = 2 ; static final int DERIVATION_UNION = 4 ; static final int DERIVATION_LIST = 8 ; public XSComplexTypeDecl ( ) { } public void setValues ( String name , String targetNamespace , XSTypeDefinition baseType , short derivedBy , short schemaFinal , short block , short contentType , boolean isAbstract , XSAttributeGroupDecl attrGrp , XSSimpleType simpleType , XSParticleDecl particle , XSObjectListImpl annotations ) { } public void setName ( String name ) { } public short getTypeCategory ( ) { } public String getTypeName ( ) { } public short getFinalSet ( ) { } public String getTargetNamespace ( ) { } private static final short CT_IS_ABSTRACT = 1 ; private static final short CT_HAS_TYPE_ID = 2 ; private static final short CT_IS_ANONYMOUS = 4 ; public boolean containsTypeID ( ) { } public void setIsAbstractType ( ) { } public void setContainsTypeID ( ) { } public void setIsAnonymous ( ) { } public XSCMValidator getContentModel ( CMBuilder cmBuilder ) { } public synchronized XSCMValidator getContentModel ( CMBuilder cmBuilder , boolean forUPA ) { } public XSAttributeGroupDecl getAttrGrp ( ) { } public String toString ( ) { } void appendTypeInfo ( StringBuffer str ) { } public boolean derivedFromType ( XSTypeDefinition ancestor , short derivationMethod ) { } public boolean derivedFrom ( String ancestorNS , String ancestorName , short derivationMethod ) { } public boolean isDOMDerivedFrom ( String ancestorNS , String ancestorName , int derivationMethod ) { } private boolean isDerivedByAny ( String ancestorNS , String ancestorName , int derivationMethod , XSTypeDefinition type ) { } private boolean isDerivedByRestriction ( String ancestorNS , String ancestorName , int derivationMethod , XSTypeDefinition type ) { } private boolean isDerivedByExtension ( String ancestorNS , String ancestorName , int derivationMethod , XSTypeDefinition type ) { } public void reset ( ) { fName = null ; fTargetNamespace = null ; fBaseType = null ; fDerivedBy = XSConstants . DERIVATION_RESTRICTION ; fFinal = XSConstants . DERIVATION_NONE ; fBlock = XSConstants . DERIVATION_NONE ; fMiscFlags = 0 ; fAttrGrp . reset ( ) ; fContentType = CONTENTTYPE_EMPTY ; fXSSimpleType = null ; fParticle = null ; fCMValidator = null ; fUPACMValidator = null ; if ( ( fAnnotations ) != null ) { <START_BUG> fAnnotations . clear ( ) ; <END_BUG> } fAnnotations = null ; } public short getType ( ) { } public String getName ( ) { } public boolean getAnonymous ( ) { } public String getNamespace ( ) { } public XSTypeDefinition getBaseType ( ) { } public short getDerivationMethod ( ) { } public boolean isFinal ( short derivation ) { } public short getFinal ( ) { } public boolean getAbstract ( ) { } public XSObjectList getAttributeUses ( ) { } public XSWildcard getAttributeWildcard ( ) { } public short getContentType ( ) { } public XSSimpleTypeDefinition getSimpleType ( ) { } public XSParticle getParticle ( ) { } public boolean isProhibitedSubstitution ( short prohibited ) { } public short getProhibitedSubstitutions ( ) { } public XSObjectList getAnnotations ( ) { } public XSNamespaceItem getNamespaceItem ( ) { } void setNamespaceItem ( XSNamespaceItem namespaceItem ) { } public XSAttributeUse getAttributeUse ( String namespace , String name ) { } public String getTypeNamespace ( ) { } public boolean isDerivedFrom ( String typeNamespaceArg , String typeNameArg , int derivationMethod ) { } }

Fix:
fAnnotations . clearXSObjectList ( ) ;