<div dir="ltr">Well, my guess is that the original intent was to provide an easy way to remove qualifiers or interceptor binding with members from class or method. It&#39;s powerful but probably too overkill.<div><br></div><div>+1 for your proposal.<br></div><div><br></div><div>Antoine</div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Nov 25, 2016 at 4:56 PM Martin Kouba &lt;<a href="mailto:mkouba@redhat.com">mkouba@redhat.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="gmail_msg">
<br class="gmail_msg">
while working on <a href="https://issues.jboss.org/browse/CDI-646" rel="noreferrer" class="gmail_msg" target="_blank">https://issues.jboss.org/browse/CDI-646</a> I figured out<br class="gmail_msg">
that all &quot;AnnotatedX.remove(Annotation annotation)&quot; methods declare the<br class="gmail_msg">
following javadoc:<br class="gmail_msg">
<br class="gmail_msg">
&quot;Remove annotations with (a) the same type and (b) the same annotation<br class="gmail_msg">
member value for each member which is not annotated {@link Nonbinding}.<br class="gmail_msg">
The container calls the {@link Object#equals(Object)} method of the<br class="gmail_msg">
annotation member value to compare values.&quot;<br class="gmail_msg">
<br class="gmail_msg">
I don&#39;t think this is correct. @Nonbinding is only used for interceptors<br class="gmail_msg">
bindings and qualifiers whereas the purpose of AnnotatedType SPI is more<br class="gmail_msg">
general.<br class="gmail_msg">
<br class="gmail_msg">
I believe those remove() methods should simply use<br class="gmail_msg">
java.lang.annotation.Annotation.equals(Object) to identify annotations<br class="gmail_msg">
to remove.<br class="gmail_msg">
<br class="gmail_msg">
What do you think?<br class="gmail_msg">
<br class="gmail_msg">
Thanks,<br class="gmail_msg">
<br class="gmail_msg">
Martin<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
cdi-dev mailing list<br class="gmail_msg">
<a href="mailto:cdi-dev@lists.jboss.org" class="gmail_msg" target="_blank">cdi-dev@lists.jboss.org</a><br class="gmail_msg">
<a href="https://lists.jboss.org/mailman/listinfo/cdi-dev" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.jboss.org/mailman/listinfo/cdi-dev</a><br class="gmail_msg">
<br class="gmail_msg">
Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (<a href="http://www.apache.org/licenses/LICENSE-2.0.html" rel="noreferrer" class="gmail_msg" target="_blank">http://www.apache.org/licenses/LICENSE-2.0.html</a>). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.<br class="gmail_msg">
</blockquote></div>