RFR: 8296390: Incremental build failed with a NPE

Kevin Walls kevinw at openjdk.org
Thu Nov 10 22:53:34 UTC 2022

On Fri, 4 Nov 2022 14:05:05 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

> In [Enter](https://github.com/openjdk/jdk/blob/22347e46f7e66a864ea987fa084c44792cae2e6a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Enter.java#L617), we finish verification that imports in files are valid. But, if the module graph is not finished yet (modules are not initialized), we defer checking imports in module-infos until the modules are setup.
> What can happen is that `java.base`', if load lazily, may not be completed as part of module system initialization, and can trigger imports check in other module prematurely.
> The proposal is to explicitly complete `java.base` while setting up the compile-time module system. Other (named) modules are normally completed around the same time while [building all modules](https://github.com/openjdk/jdk/blob/22347e46f7e66a864ea987fa084c44792cae2e6a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java#L1414).

Not a review exactly, but I'm hitting this problem, and the one-line change does fix it.  Incremental builds work again.


PR: https://git.openjdk.org/jdk/pull/10985

More information about the compiler-dev mailing list