[cdi-dev] Clarify AnnotatedTypeConfigurator.remove(Annotation annotation)
Martin Kouba
mkouba at redhat.com
Fri Nov 25 10:54:17 EST 2016
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
More information about the cdi-dev
mailing list