Details
-
Bug
-
Resolution: Not an Issue
-
P4
-
7
-
generic
-
generic
Description
javac (with the module support) fails to compile module-info.java file when an annotation processor is specified via the -processor option. Without the -processor option, javac successfully compiles that module-info.java file.
To reproduce:
// m/module-info.java
@ImportModules({
@ImportModule(name="java.se")
})
module m;
$ <JDK>/bin/javac -source 7 -target 7 module-info.java
- compiled successfully
$ <JDK>/bin/javac -source 7 -target 7 -processor MyProcessor module-info.java
initialising...
module-info.java:1: incompatible types
found : java.module.annotation.ImportModules
required: java.lang.annotation.Annotation
@ImportModules({
^
1 error
Attached is the MyProcessor.java.
To reproduce:
// m/module-info.java
@ImportModules({
@ImportModule(name="java.se")
})
module m;
$ <JDK>/bin/javac -source 7 -target 7 module-info.java
- compiled successfully
$ <JDK>/bin/javac -source 7 -target 7 -processor MyProcessor module-info.java
initialising...
module-info.java:1: incompatible types
found : java.module.annotation.ImportModules
required: java.lang.annotation.Annotation
@ImportModules({
^
1 error
Attached is the MyProcessor.java.