Hi Mark, I reread the Spec about this issue (particularly 11.4). It says "The container must use the operations of Annotated and its subinterfaces to discover program element types and annotations, instead of directly calling the Java Reflection API". In 11.5.5 the spec says "The container must use the final value of this property [...] to discover the types and read the annotations of the program elements".
Reading this two sentences together I would say, OpenWebBeans has a bug since it calls the Reflection API in addition of reading the annotations from the AnnotatedType. But this two sentences are not really close to each other in the spec. So the intention of the spec is not obvious here. I'll write a comment to CDI-70 and file a bug for OpenWebBeans (and provide a patch, since it is not much to do). Regards, Arne -----Ursprüngliche Nachricht----- Von: Mark Struberg [mailto:[email protected]] Gesendet: Freitag, 6. Mai 2011 08:58 An: [email protected] Betreff: Re: Bug in ProcessAnnotatedType? Hi Arne! Could you please add your findings to CDI-70? Have not yet looked at it in detail (today fighting with my new mac...) but it sounds like it would make sense to make this clear in the spec. LieGrue, strub (who is slowly picking up speed again) ----- Original Message ----- > From: Arne Limburg <[email protected]> > To: "[email protected]" <[email protected]> > Cc: > Sent: Wednesday, May 4, 2011 12:13 PM > Subject: Bug in ProcessAnnotatedType? > > Hi, > > I recognized that the AnnotatedType returned by the > ProcessAnnotatedType event does not contain fields, methods and > constructors of the superclass. Is this intentional or would you > consider this to be a bug? I am afraid that the Spec is not quite clear about > this again. > > This is definitely not the behavior I, being an Extension-developer, > would expect. I am writing an Extension, that replaces annotations of > fields, constructors and methods. With your implementation I am not > able to replace annotations of superclasses as after processing of my > provided AnntatedType you call > DefinitionUtil.defineInternalInjectedFieldsRecursively and walk through the > fields by reflection. > Imho you only should use the AnnotatedType here (and it should contain > Fields, Constructors and Methods of superclasses). > > @Mark: This should be clarified in CDI 1.1 > https://issues.jboss.org/browse/CDI-70 says the same, but it is only > the second part. The first part is, that the AnnotatedType should > contain fields, constructors and methods of the superclass or should > get a method getSuperType(). This is not addressed by the 1.1 version > of the Spec for now as far as I can see. > > Regards, > Arne > > -- > > Arne Limburg - Enterprise Architect > open knowledge GmbH, Oldenburg > Bismarckstraße 13, 26122 Oldenburg > Mobil: +49 (0) 151 108 22 942 > Tel: +49 (0) 441 - 4082-0 > Fax: +49 (0) 441 - 4082-111 > [email protected]<mailto:[email protected]> > http://www.openknowledge.de > > Registergericht: Amtsgericht Oldenburg, HRB 4670 > Geschäftsführer: Lars Röwekamp, Jens Schumann >
