-
Bug
-
Resolution: Fixed
-
P3
-
8
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8038390 | 9 | Joel Borggrén-Franck | P3 | Closed | Fixed | b08 |
JDK-8045135 | 8u25 | Joel Borggrén-Franck | P3 | Resolved | Fixed | b01 |
JDK-8052574 | emb-8u26 | Joel Borggrén-Franck | P3 | Resolved | Fixed | b17 |
Liam writes:
There appears to be a javac8 bug that prevents annotation processors from
visiting annotations on parameters. When repeated annotations were
implemented 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);
There appears to be a javac8 bug that prevents annotation processors from
visiting annotations on parameters. When repeated annotations were
implemented 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);
- backported by
-
JDK-8045135 annotation processors don't visit declaration parameter annotations
- Resolved
-
JDK-8052574 annotation processors don't visit declaration parameter annotations
- Resolved
-
JDK-8038390 annotation processors don't visit declaration parameter annotations
- Closed
- duplicates
-
JDK-8067733 annotations on parameters are not visible when processing class files
- Closed
- relates to
-
JDK-7162089 Add support for repeating annotations to javax.annotation.processing
- Closed