javac8 annotation processors don't visit parameter annotations

Liam Miller-Cushon cushon at google.com
Fri Mar 21 16:51:40 UTC 2014


Thanks Joel, that's great.

Liam


On Fri, Mar 21, 2014 at 2:50 AM, Joel Borggren-Franck <
joel.franck at oracle.com> wrote:

> Hi Liam,
>
> Thanks!
>
> I filed https://bugs.openjdk.java.net/browse/JDK-8038080
>
> I intend to submit your fix for 9 and 8u20.
>
> cheers
> /Joel
>
> On 2014-03-05, Liam Miller-Cushon wrote:
> > There appears to be a javac8 bug that prevents annotation processors from
> > visiting annotations on parameters. When repeated annotations were
> > implemented [1][2] the annotation scanners in JavacProcessingEnvironment
> > and JavacRoundEnvironment were modified and the following override was
> > added:
> >
> > @Override
> > public Set<TypeElement> visitExecutable(ExecutableElement e,
> > Set<TypeElement> p) {
> >   // Type parameters are not considered to be enclosed by an executable
> >   scan(e.getTypeParameters(), p);
> >   return scan(e.getEnclosedElements(), p);
> > }
> >
> > MethodSymbols don't have any enclosed elements, but they do have
> parameters
> > (which currently aren't being visited). I think that line was meant to
> > match the base implementation in ElementScanner:
> >
> > return scan(e.getParameters(), p);
> >
> >
> > [1] https://bugs.openjdk.java.net/browse/JDK-7162089
> > [2] http://hg.openjdk.java.net/jdk8/jdk8/langtools/rev/1908e86ee49a
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20140321/9a4a35ae/attachment.html>


More information about the compiler-dev mailing list