Should @SupportedAnnotationTypes handle TYPE_USE?

B. Blaser bsrbnd at gmail.com
Tue Sep 25 09:42:18 UTC 2018


On Tue, 25 Sep 2018 at 05:07, joe darcy <joe.darcy at oracle.com> wrote:
>
> Hi Bernard,
>
>
> On 9/24/2018 3:05 PM, B. Blaser wrote:
> > Hi,
> >
> > I noted that the annotation processor [1] isn't run if
> > @SupportedAnnotationTypes ({"TA"}) is used instead of ({"*"}) because
> > annotations on TYPE_USE don't seem to be handled when selecting
> > processors.
> >
> > Is this normal or should we add something like below (to be completed)?
> > The documentation [2] isn't clear about that.
>
> The documentation of the Processor interface covers this situation:
>
> " Annotations on type uses, as opposed to annotations on elements, are
> ignored when computing whether or not an annotation type is present."
> https://docs.oracle.com/javase/10/docs/api/javax/annotation/processing/Processor.html

Thanks Joe, I missed it :-(
But is there any justification for this or is it planned to handle
annotations on type use when selecting processor?
It should be possible to do that as I showed with the draft I posted yesterday.
Using "*" means that processors focusing on type use are always run
which isn't what we'd expect and not optimal in performance terms...

Bernard

> HTH,
>
> -Joe
>


More information about the compiler-dev mailing list