[cdi-dev] [JBoss JIRA] (CDI-620) Not clear what the id for an annotated type is.

Martin Kouba (JIRA) issues at jboss.org
Tue Jul 19 02:57:00 EDT 2016

    [ https://issues.jboss.org/browse/CDI-620?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13267200#comment-13267200 ] 

Martin Kouba commented on CDI-620:

Yep, the ordering of {{AfterTypeDiscovery.addAnnotatedType(String, Class<T>)}} should be the same as {{AfterTypeDiscovery.addAnnotatedType(AnnotatedType<?>, String)}}.

The identifier is used to distinguish multiple AnnotatedTypes per the same Java class. See also the javadoc:
This method allows multiple annotated types, based on the same underlying type, to be defined. {{AnnotatedType}}s discovered by the container use the fully qualified class name of {{AnnotatedType#getJavaClass()}} to identify the type.

For more details see also https://issues.jboss.org/browse/CDI-58.

WRT impl. detail of  {{AfterTypeDiscovery.addAnnotatedType(AnnotatedType<?>, String)}} - Weld generates a unique id for an annotated type if the id is null.

> Not clear what the id for an annotated type is.
> -----------------------------------------------
>                 Key: CDI-620
>                 URL: https://issues.jboss.org/browse/CDI-620
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>            Reporter: John Ament
> The docs for AfterTypeDiscovery.addAnnotatedType(String, Class) do not state what the id is.
> In addition, it's odd that the addAnnotatedType(AnnotatedType, String) is in that order, and this method is in this order.

This message was sent by Atlassian JIRA

More information about the cdi-dev mailing list