[weld-issues] [JBoss JIRA] Commented: (WELD-335) RIBean needs new definition of equality
Pete Muir (JIRA)
jira-events at lists.jboss.org
Mon Dec 14 05:55:31 EST 2009
[ https://jira.jboss.org/jira/browse/WELD-335?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12499729#action_12499729 ]
Pete Muir commented on WELD-335:
Thanks Stuart. I thought about this again, and I'm not sure this is the correct approach (making the ID for container generated beans different).
I think first we need to write some tests that show where this is a problem, and then address the causes of those failures (i.e. let's adjust a few things, rather than throw everything out and start again). The reason I came to this conclusion is that there is no way I can see that someone would actually try to reuse the id of a built in bean - the only case when this happens is if you wrap a container generated bean, in which case you would need to implement PassivationCapable yourself, and hence provide a *different* id. If you didn't, your wrapper wouldn't forward calls to id. It would to equals and hashcode, hence the need to identify where we are mapping stuff incorrectly.
> 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: 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