Buggy code:
} } else { String text = DOMUtil . getSyntheticAnnotation ( complexContent ) ; if ( text != null ) { addAnnotation ( traverseSyntheticAnnotation ( complexContent , text , derivationTypeAttrValues , false , schemaDoc ) ) ; } } try { processComplexContent ( complexContent , mixedContent , true , schemaDoc , grammar ) ; } catch ( XSDComplexTypeTraverser . ComplexTypeRecoverableError e ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw e ; } XSParticleDecl baseContent = ( ( XSParticleDecl ) ( baseType . getParticle ( ) ) ) ; if ( ( fDerivedBy ) == ( XSConstants . DERIVATION_RESTRICTION ) ) { if ( ( ( fContentType ) == ( XSComplexTypeDecl . CONTENTTYPE_MIXED ) ) && ( ( baseType . getContentType ( ) ) != ( XSComplexTypeDecl . CONTENTTYPE_MIXED ) ) ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw new XSDComplexTypeTraverser . ComplexTypeRecoverableError ( "derivation-ok-restriction.5.4.1.2" , new Object [ ] { fName , baseType . getName ( ) } , complexContent ) ; } try { mergeAttributes ( baseType . getAttrGrp ( ) , fAttrGrp , fName , false , complexContent ) ; } catch ( XSDComplexTypeTraverser . ComplexTypeRecoverableError e ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw e ; } fAttrGrp . removeProhibitedAttrs ( ) ; if ( baseType != ( SchemaGrammar . fAnyType ) ) { Object [ ] errArgs = fAttrGrp . validRestrictionOf ( fName , baseType . getAttrGrp ( ) ) ; if ( errArgs != null ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw new XSDComplexTypeTraverser . ComplexTypeRecoverableError ( ( ( String ) ( errArgs [ ( ( errArgs . length ) - 1 ) ] ) ) , errArgs , complexContent ) ; } } } else { if ( ( fParticle ) == null ) { fContentType = baseType . getContentType ( ) ; fXSSimpleType = ( ( XSSimpleType ) ( baseType . getSimpleType ( ) ) ) ; fParticle = baseContent ; } else if ( ( baseType . getContentType ( ) ) == ( XSComplexTypeDecl . CONTENTTYPE_EMPTY ) ) { } else { if ( ( ( fContentType ) == ( XSComplexTypeDecl . CONTENTTYPE_ELEMENT ) ) && ( ( baseType . getContentType ( ) ) != ( XSComplexTypeDecl . CONTENTTYPE_ELEMENT ) ) ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw new XSDComplexTypeTraverser . ComplexTypeRecoverableError ( "cos-ct-extends.1.4.3.2.2.1.a" , new Object [ ] { fName } , complexContent ) ; } else if ( ( ( fContentType ) == ( XSComplexTypeDecl . CONTENTTYPE_MIXED ) ) && ( ( baseType . getContentType ( ) ) != ( XSComplexTypeDecl . CONTENTTYPE_MIXED ) ) ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw new XSDComplexTypeTraverser . ComplexTypeRecoverableError ( "cos-ct-extends.1.4.3.2.2.1.b" , new Object [ ] { fName } , complexContent ) ; } if ( ( ( ( fParticle . fType ) == ( XSParticleDecl . PARTICLE_MODELGROUP ) ) && ( ( ( ( XSModelGroupImpl ) ( fParticle . fValue ) ) . fCompositor ) == ( XSModelGroupImpl . MODELGROUP_ALL ) ) ) || ( ( ( ( ( XSParticleDecl ) ( baseType . getParticle ( ) ) ) . fType ) == ( XSParticleDecl . PARTICLE_MODELGROUP ) ) && ( ( ( ( XSModelGroupImpl ) ( ( ( XSParticleDecl ) ( baseType . getParticle ( ) ) ) . fValue ) ) . fCompositor ) == ( XSModelGroupImpl . MODELGROUP_ALL ) ) ) ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw new XSDComplexTypeTraverser . ComplexTypeRecoverableError ( "cos-all-limited.1.2" , new Object [ ] { } , complexContent ) ; } XSModelGroupImpl group = new XSModelGroupImpl ( ) ; group . fCompositor = XSModelGroupImpl . MODELGROUP_SEQUENCE ; group . fParticleCount = 2 ; group . fParticles = new XSParticleDecl [ 2 ] ; group . fParticles [ 0 ] = ( ( XSParticleDecl ) ( baseType . getParticle ( ) ) ) ; group . fParticles [ 1 ] = fParticle ; group . fAnnotations = XSObjectListImpl . EMPTY_LIST ; XSParticleDecl particle = new XSParticleDecl ( ) ; particle . fType = XSParticleDecl . PARTICLE_MODELGROUP ; particle . fValue = group ; <START_BUG> particle . fAnnotations = fParticle . getAnnotations ( ) ; <END_BUG> fParticle = particle ; } fAttrGrp . removeProhibitedAttrs ( ) ; try { mergeAttributes ( baseType . getAttrGrp ( ) , fAttrGrp , fName , true , complexContent ) ; } catch ( XSDComplexTypeTraverser . ComplexTypeRecoverableError e ) { fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; throw e ; } } fAttrChecker . returnAttrArray ( complexContentAttrValues , schemaDoc ) ; fAttrChecker . returnAttrArray ( derivationTypeAttrValues , schemaDoc ) ; } private void mergeAttributes ( XSAttributeGroupDecl fromAttrGrp , XSAttributeGroupDecl toAttrGrp , String typeName , boolean extension , Element elem ) throws XSDComplexTypeTraverser . ComplexTypeRecoverableError { } private void processComplexContent ( Element complexContentChild , boolean isMixed , boolean isDerivation , XSDocumentInfo schemaDoc , SchemaGrammar grammar ) throws XSDComplexTypeTraverser . ComplexTypeRecoverableError { } private boolean isAttrOrAttrGroup ( Element e ) { } private void traverseSimpleContentDecl ( Element simpleContentDecl ) { } private void traverseComplexContentDecl ( Element complexContentDecl , boolean mixedOnComplexTypeDecl ) { } private String genAnonTypeName ( Element complexTypeDecl ) { } private void handleComplexTypeError ( String messageId , Object [ ] args , Element e ) { } private XSParticleDecl getErrorContent ( ) { } private XSWildcardDecl getErrorWildcard ( ) { } private void contentBackup ( ) { } private void contentRestore ( ) { } private void addAnnotation ( XSAnnotationImpl annotation ) { } }

Fix:
particle . fAnnotations = XSObjectListImpl . EMPTY_LIST ;