-
Bug
-
Resolution: Unresolved
-
P3
-
15
-
Cause Known
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
Mac OS X 10.14.6
18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
JDKs tested:
- AdoptOpenJDK (build 15.0.2+7)
- OpenJDK Zulu15.28+51-CA (build 15.0.1+9)
Apache Maven 3.6.3, maven-compiler-plugin 3.8.1 set to JDK 15 with preview features enabled.
A DESCRIPTION OF THE PROBLEM :
While migrating a project to JPMS on JDK 15 with preview features, the compiler encounters an internal NPE in com.sun.tools.javac.file.JavacFileManager.hasExplicitLocation / BaseFileManager.nullCheck
Here is the full compilation log when run using "mvn clean compile":
https://pastebin.com/yKemA2SS
The project in question is an incredibly tortured legacy application which has been brought back to life using JPMS. It has 2 project modules, some filename-based module dependencies, and split packages. Funny enough, it is also using preview features of JDK 15.
At the time the error in question occurred, the project was being converted to use module-info files. The module-info files are present, but plenty of split packages exist and still need to be resolved.
The project should not compile normally; it has undeclared dependencies and split packages which should prevent compilation. However, despite these compilation issues, javac should not fail with an internal NPE.
Adding the missing "requires" directive solves the problem, and makes javac fail with a message about split packages as opposed to an internal NPE.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
It is not easy to reproduce this bug. It happens only on the convoluted application.
It was attempted to reproduce the bug in a new project and adding split packages and undeclared module dependencies, but the reproduction was unsuccessful.
The exact environment in which the error occurred is still present and has not been modified. The bug can be reproduced repeatedly using the application source code, though I am not sure as to the cause of it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected unresolved compilation errors (user-facing messages), indicating split packages are present and unread packages are used.
ACTUAL -
The compiler encounters an internal NPE:
https://pastebin.com/yKemA2SS (AdoptOpenJDK 15.0.2)
https://pastebin.com/iJ3DQiRE (ZuluJDK 15.0.1; stacktrace identical)
---------- BEGIN SOURCE ----------
The project source code would not be appropriate to share publicly - please contact if you want to inspect the full source, including project layout, build configuration, module-info files, and source code.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding the missing "requires" directive solves the problem, and makes javac fail with a user-facing message about split packages as opposed to an internal NPE.
FREQUENCY : always
Mac OS X 10.14.6
18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64
JDKs tested:
- AdoptOpenJDK (build 15.0.2+7)
- OpenJDK Zulu15.28+51-CA (build 15.0.1+9)
Apache Maven 3.6.3, maven-compiler-plugin 3.8.1 set to JDK 15 with preview features enabled.
A DESCRIPTION OF THE PROBLEM :
While migrating a project to JPMS on JDK 15 with preview features, the compiler encounters an internal NPE in com.sun.tools.javac.file.JavacFileManager.hasExplicitLocation / BaseFileManager.nullCheck
Here is the full compilation log when run using "mvn clean compile":
https://pastebin.com/yKemA2SS
The project in question is an incredibly tortured legacy application which has been brought back to life using JPMS. It has 2 project modules, some filename-based module dependencies, and split packages. Funny enough, it is also using preview features of JDK 15.
At the time the error in question occurred, the project was being converted to use module-info files. The module-info files are present, but plenty of split packages exist and still need to be resolved.
The project should not compile normally; it has undeclared dependencies and split packages which should prevent compilation. However, despite these compilation issues, javac should not fail with an internal NPE.
Adding the missing "requires" directive solves the problem, and makes javac fail with a message about split packages as opposed to an internal NPE.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
It is not easy to reproduce this bug. It happens only on the convoluted application.
It was attempted to reproduce the bug in a new project and adding split packages and undeclared module dependencies, but the reproduction was unsuccessful.
The exact environment in which the error occurred is still present and has not been modified. The bug can be reproduced repeatedly using the application source code, though I am not sure as to the cause of it.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Expected unresolved compilation errors (user-facing messages), indicating split packages are present and unread packages are used.
ACTUAL -
The compiler encounters an internal NPE:
https://pastebin.com/yKemA2SS (AdoptOpenJDK 15.0.2)
https://pastebin.com/iJ3DQiRE (ZuluJDK 15.0.1; stacktrace identical)
---------- BEGIN SOURCE ----------
The project source code would not be appropriate to share publicly - please contact if you want to inspect the full source, including project layout, build configuration, module-info files, and source code.
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding the missing "requires" directive solves the problem, and makes javac fail with a user-facing message about split packages as opposed to an internal NPE.
FREQUENCY : always
- links to
-
Review openjdk/jdk/4523