-
Bug
-
Resolution: Fixed
-
P2
-
9
-
b145
-
Verified
NPE is thrown by javac from JDK9 build 140 when:
1. module being compiled is declared in a file named other than "module-info";
2. annotation processor is specified;
3. '--module-source-path' option is specified to javac.
The minimized testcase is attached. In order to reproduce it, please:
1. Unzip attached archive on some Unix/Linux machine to a directory, say A.
2. Modify A/Test57/test.sh by setting JDK_HOME environment variable to your JDK installation.
3. Run A/Test57/test.sh.
The minimized test case produces following output on JDK 9 build 140:
An exception has occurred in the compiler (9-ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at com.sun.tools.javac.comp.Modules.setCompilationUnitModules(jdk.compiler@9-ea/Modules.java:352)
at com.sun.tools.javac.comp.Modules.enter(jdk.compiler@9-ea/Modules.java:248)
at com.sun.tools.javac.comp.Modules.initModules(jdk.compiler@9-ea/Modules.java:214)
at com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler@9-ea/JavaCompiler.java:1048)
at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-ea/JavaCompiler.java:942)
at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-ea/Main.java:304)
at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-ea/Main.java:160)
at com.sun.tools.javac.Main.compile(jdk.compiler@9-ea/Main.java:55)
at com.sun.tools.javac.Main.main(jdk.compiler@9-ea/Main.java:41)
1. module being compiled is declared in a file named other than "module-info";
2. annotation processor is specified;
3. '--module-source-path' option is specified to javac.
The minimized testcase is attached. In order to reproduce it, please:
1. Unzip attached archive on some Unix/Linux machine to a directory, say A.
2. Modify A/Test57/test.sh by setting JDK_HOME environment variable to your JDK installation.
3. Run A/Test57/test.sh.
The minimized test case produces following output on JDK 9 build 140:
An exception has occurred in the compiler (9-ea). Please file a bug against the Java compiler via the Java bug reporting page (http://bugreport.java.com) after checking the Bug Database (http://bugs.java.com) for duplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.NullPointerException
at com.sun.tools.javac.comp.Modules.setCompilationUnitModules(jdk.compiler@9-ea/Modules.java:352)
at com.sun.tools.javac.comp.Modules.enter(jdk.compiler@9-ea/Modules.java:248)
at com.sun.tools.javac.comp.Modules.initModules(jdk.compiler@9-ea/Modules.java:214)
at com.sun.tools.javac.main.JavaCompiler.initModules(jdk.compiler@9-ea/JavaCompiler.java:1048)
at com.sun.tools.javac.main.JavaCompiler.compile(jdk.compiler@9-ea/JavaCompiler.java:942)
at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-ea/Main.java:304)
at com.sun.tools.javac.main.Main.compile(jdk.compiler@9-ea/Main.java:160)
at com.sun.tools.javac.Main.compile(jdk.compiler@9-ea/Main.java:55)
at com.sun.tools.javac.Main.main(jdk.compiler@9-ea/Main.java:41)
- duplicates
-
JDK-8163865 NPE when compiling non compilable sources with annotation processor via JSR199 API
-
- Closed
-