[ 
https://issues.apache.org/jira/browse/OWB-1099?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15033370#comment-15033370
 ] 

Mark Struberg commented on OWB-1099:
------------------------------------

Hi Antonin!

I fear you will end up being non-portable if your Extension relies on 
AnnotatedType not using instance equality but require all AnnotatedTypes 
implementing logical equals and hashCode. 

* it's not required by the spec. And more important: the spec doesn't define 
WHAT must be equal.
* OWB doesn't implement it
* many Weld versions don't implement it afaik
* No single custom Extension wrapping/modifying AnnotatedTypes I ever saw 
implemented it
* DeltaSpike AnnotetedImpl doesn't implement it
* CODI doesn't implement it
* The builder from Seam3 doesn't implement it
...

All in all you simply cannot rely on it as you don't know what other CDI 
Extensions are present in your customers project.

What is the actual problem you like to solve? I did never have the urge for it 
so far - and I've done quite a few Extensions as you probably know ;)

> Annotated SPI implementations do not override equals and hashCode
> -----------------------------------------------------------------
>
>                 Key: OWB-1099
>                 URL: https://issues.apache.org/jira/browse/OWB-1099
>             Project: OpenWebBeans
>          Issue Type: Bug
>    Affects Versions: 1.6.2
>            Reporter: Antonin Stefanutti
>
> The implementations of the {{Annotated}} SPIs do not override {{equals}} and 
> {{hashCode}}.
> This prevents from looking up bean definitions by annotated elements which is 
> often required when developing CDI extensions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to