[cdi-dev] Should AnnotatedType also reflect inherited information?

Mark Struberg struberg at yahoo.de
Tue May 24 10:20:03 EDT 2011


When initially building the AnnotatedType (e.g. before handing it over to the Extensions) we need to pre-fill them with the info from the annotations from the classes. 

Should this AnnotatedType:
1.) contain no annotations from superclasses?
2.) contain all annotations from superclasses? 
3.) contain @Inherited annotations from superclasses?

LieGrue,
strub

--- On Tue, 5/24/11, Pete Muir <pmuir at redhat.com> wrote:

> From: Pete Muir <pmuir at redhat.com>
> Subject: Re: AW: [cdi-dev] Should AnnotatedType also reflect inherited information?
> To: "Mark Struberg" <struberg at yahoo.de>
> Cc: "Arne Limburg" <arne.limburg at openknowledge.de>, "cdi-dev at lists.jboss.org" <cdi-dev at lists.jboss.org>
> Date: Tuesday, May 24, 2011, 11:03 AM
> What does "resolved" mean in this
> case?
> 
> On 23 May 2011, at 22:51, Mark Struberg wrote:
> 
> > Hi!
> > 
> > There are still subtle differences open. E.g. should
> annotations from a superclass ct get resolved if they have
> @Inherited? 
> > 
> > LieGrue,
> > strub
> > 
> > --- On Mon, 5/23/11, Peter Muir <pmuir at redhat.com>
> wrote:
> > 
> >> From: Peter Muir <pmuir at redhat.com>
> >> Subject: Re: AW: [cdi-dev] Should AnnotatedType
> also reflect inherited information?
> >> To: "Arne Limburg" <arne.limburg at openknowledge.de>
> >> Cc: "Mark Struberg" <struberg at yahoo.de>,
> "cdi-dev at lists.jboss.org"
> <cdi-dev at lists.jboss.org>
> >> Date: Monday, May 23, 2011, 9:48 PM
> >> I think it's ok now
> >> 
> >> --
> >> Pete Muir
> >> http://in.relation.to/Bloggers/Pete
> > 
> >> 
> >> On 23 May 2011, at 22:41, Arne Limburg <arne.limburg at openknowledge.de>
> >> wrote:
> >> 
> >>> Maybe we should explicitly state that
> AnnotatedType
> >> contains superclass information. Currently it's
> implicit
> >> because of my wording and the fact, that
> Annotations on
> >> superclasses are processed (i.e. @Inject on
> superclasses
> >> works).
> >>> 
> >>> Regards,
> >>> Arne
> >>> 
> >>> -----Ursprüngliche Nachricht-----
> >>> Von: Peter Muir [mailto:pmuir at redhat.com]
> >> 
> >>> Gesendet: Montag, 23. Mai 2011 23:28
> >>> An: Arne Limburg
> >>> Cc: Mark Struberg; cdi-dev at lists.jboss.org
> >>> Betreff: Re: [cdi-dev] Should AnnotatedType
> also
> >> reflect inherited information?
> >>> 
> >>> Yes, AnnotatedType is the *only* source of
> metadata,
> >> reflection must not be used. Arne's wording is in
> HEAD.
> >>> 
> >>> --
> >>> Pete Muir
> >>> http://in.relation.to/Bloggers/Pete
> > 
> >>> 
> >>> On 23 May 2011, at 22:25, Arne Limburg <arne.limburg at openknowledge.de>
> >> wrote:
> >>> 
> >>>> Hi,
> >>>> 
> >>>> My suggestions on this will make it clear
> for CDI
> >> 1.1:
> >>>> https://issues.jboss.org/browse/CDI-70
> > 
> >>>> With this clarifications the current
> >> implementation in OWB would be illegal since it
> introspects
> >> the superclass using reflection instead of using
> the
> >> AnnotatedType (which currently would not work,
> since the
> >> AnnotatedType does not contain this information).
> >>>> 
> >>>> The problem here is, that if the
> AnnotatedType
> >> does not contain information of superclass
> hierarchy (like
> >> currently in OWB), there is no way for Extensions
> to modify
> >> annotations of superclasses (i.e. add a qualifier
> to an
> >> @Inject-field or -method). Nothing seems to
> indicate that
> >> this was the intention of the CDI 1.0 spec ;-)
> >>>> 
> >>>> Kind regards,
> >>>> Arne
> >>>> 
> >>>> -----Ursprüngliche Nachricht-----
> >>>> Von: cdi-dev-bounces at lists.jboss.org
> >> [mailto:cdi-dev-bounces at lists.jboss.org]
> >> Im Auftrag von Mark Struberg
> >>>> Gesendet: Montag, 23. Mai 2011 23:13
> >>>> An: cdi-dev at lists.jboss.org
> >>>> Betreff: [cdi-dev] Should AnnotatedType
> also
> >> reflect inherited information?
> >>>> 
> >>>> Hi!
> >>>> 
> >>>> I think the spec is not explicit on this
> question:
> >> Should the AnnotatedType delivered to the
> Extensions as
> >> parameter or via BeanManager#getAnnostatedType()
> also
> >> deliver information gathered from it's superclass
> >> hierarchy?
> >>>> 
> >>>> Sounds reasonable, but is nowhere
> explicitely
> >> defined. Thus I better ask ;)
> >>>> 
> >>>> txs and LieGrue,
> >>>> strub
> >>>>
> _______________________________________________
> >>>> cdi-dev mailing list
> >>>> cdi-dev at lists.jboss.org
> >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev
> > 
> >>>> 
> >>>>
> _______________________________________________
> >>>> cdi-dev mailing list
> >>>> cdi-dev at lists.jboss.org
> >>>> https://lists.jboss.org/mailman/listinfo/cdi-dev
> > 
> >> 
> 
> 



More information about the cdi-dev mailing list