[weld-issues] [JBoss JIRA] Commented: (WELD-335) RIBean needs new definition of equality

Stuart Douglas (JIRA) jira-events at lists.jboss.org
Sat Jan 16 19:33:54 EST 2010


    [ https://jira.jboss.org/jira/browse/WELD-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12506492#action_12506492 ] 

Stuart Douglas commented on WELD-335:
-------------------------------------

It should be possible to keep the simple id's if the bean is vetoed, however it probably would not be pretty. Also if a bean was vetoed and then two different beans of the same class type were added through the SPI then you could not use the simple id, as it would be random as which one get the simple id an which one gets the complex one. 

The id's for producer fields etc still have to be fixed up in a similar manner. 

After thinking about it a bit more complex id should probably only include annotations that have meaning to weld. I have a portable extension that adds a Synthetic bean id annotation to it's AnnotatedTypes, so it can identify them in the ProcessInjectionTarget event. This approach now breaks replication, as the synthetic Id's are non deterministic. This is probably not something that many people will run into, so I don't know if we should worry about it.

> RIBean needs new definition of equality
> ---------------------------------------
>
>                 Key: WELD-335
>                 URL: https://jira.jboss.org/jira/browse/WELD-335
>             Project: Weld
>          Issue Type: Bug
>          Components: Class Beans (Managed and Session), Producers (Methods, Fields and Disposers), Reflection layer
>            Reporter: Stuart Douglas
>            Assignee: Stuart Douglas
>            Priority: Critical
>             Fix For: 1.0.1.CR1
>
>         Attachments: multiple-beans-1.diff, multiple-beans-2.diff, ri-bean-id-creator.patch, ri-bean-id-creator2.patch
>
>
> Due to the implementation of equals/hashCode in RIBean only one ManagedBean is allowed per underlying java class, so for example if you use the SPI to add two AnnotatedTypes with the same underlying class but different qualifiers only one will get installed.
> The following patch fixes this, would it be possible to get some feedback on it?
> The AnnotatedTypeIdProvider class in the patch can also be used to implement meaningful equlity for WeldAnnotated*

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the weld-issues mailing list