[cdi-dev] Clarify AnnotatedTypeConfigurator.remove(Annotation annotation)

Antoine Sabot-Durand antoine at sabot-durand.net
Mon Nov 28 04:39:29 EST 2016


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's powerful but probably too overkill.

+1 for your proposal.

Antoine

On Fri, Nov 25, 2016 at 4:56 PM Martin Kouba <mkouba at redhat.com> wrote:

> Hi all,
>
> while working on https://issues.jboss.org/browse/CDI-646 I figured out
> that all "AnnotatedX.remove(Annotation annotation)" methods declare the
> following javadoc:
>
> "Remove annotations with (a) the same type and (b) the same annotation
> member value for each member which is not annotated {@link Nonbinding}.
> The container calls the {@link Object#equals(Object)} method of the
> annotation member value to compare values."
>
> I don't think this is correct. @Nonbinding is only used for interceptors
> bindings and qualifiers whereas the purpose of AnnotatedType SPI is more
> general.
>
> I believe those remove() methods should simply use
> java.lang.annotation.Annotation.equals(Object) to identify annotations
> to remove.
>
> What do you think?
>
> Thanks,
>
> Martin
> _______________________________________________
> cdi-dev mailing list
> cdi-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/cdi-dev
>
> Note that for all code provided on this list, the provider licenses the
> code under the Apache License, Version 2 (
> http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas
> provided on this list, the provider waives all patent and other
> intellectual property rights inherent in such information.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/cdi-dev/attachments/20161128/a1a28478/attachment.html 


More information about the cdi-dev mailing list