[cdi-dev] [JBoss JIRA] (CDI-58) Clarify that there can be multiple AnnotatedType instances per Java class
Mark Struberg (Commented) (JIRA)
jira-events at lists.jboss.org
Fri Oct 14 10:07:16 EDT 2011
[ https://issues.jboss.org/browse/CDI-58?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12634857#comment-12634857 ]
Mark Struberg commented on CDI-58:
----------------------------------
I fear the wording doesn't clarify the problem far enough.
There are 2 different parts involved, and we have to distinct the 'cause' from the 'effect'.
cause: a Class with all Java bytecode and later added/removed/modified annotations, ct, members, fields, parameters, etc via modifications of it's AnnotatedType
effect: multiple Bean<T> created based upon AnnotatedTypes.
In fact, the linked seam wishlist discussion is based on a (imo) misuse of AnnotatedType! The multiple Bean<T> would be much better done with a dynamically added producer method, thus no multiple AnnotatedTypes per Class are needed!
This also introduces another problem:
11.3.8 Obtaining an AnnotatedType for a class
> If the AnnotatedType for the class has been wrapped or replaced by ProcessAnnotatedType
> then the wrapped or replaced AnnotatedType should be returned BeanManager.createAnnoatedType().
this is completely broken now. Because _which_ of the n AnnotatedType impls do you return?
The whole idea of AnnotatedType in the spec originally afaik was that you always get the same instance for a class in all the various stages of the Extension mechanism where they get used and can subsequently get 'modified' while the boot process advances.
* BeforeBeanDiscovery
* ProcessAnnotatedType
* ProcessInjectionTarget
* ProcessModule
* ProcessBean
* ProcessProducer
Of course we can change this now, but this would considerably change the spec (see 11.3.8) and we would think about how to make this unambiguous (who gets which instance).
I'd just get back to the very beginning and check what we need it for and only afterwards think about possible solutions.
> Clarify that there can be multiple AnnotatedType instances per Java class
> -------------------------------------------------------------------------
>
> Key: CDI-58
> URL: https://issues.jboss.org/browse/CDI-58
> Project: CDI Specification Issues
> Issue Type: Clarification
> Components: Beans, Portable Extensions
> Affects Versions: 1.0
> Reporter: Pete Muir
> Assignee: Pete Muir
> Fix For: 1.1 (Confirmed)
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the cdi-dev
mailing list