On Fri, 27 Oct 2023 19:03:36 GMT, Calvin Cheung <cche...@openjdk.org> wrote:

> The `ArchivedModuleGraph.java` wasn't changed. So if `-m` is not specified, 
> the `archivedModuleGraph` is non-null; if `-m` is specified, the 
> `archivedModuleGraph` is null. So running `java -version`, the 
> archivedModuleGraph is non-null, but the module m won't be loaded from the 
> archive.

Right, but ArchivedModuleGraph provides the initial value for 
hasIncubatorModules, hasSplitPackages, ... This is why `java -version` 
confusingly prints a warning that an incubator module has been resolved. We've 
had archiving of the module graph (configuration) for a long time but it's only 
been for the case where the initial module is the unnamed module. I think 
archiving of the boot layer for the case where the initial module is a named 
module means we have to re-visit ArchivedModuleGraph. I think 
ArchivedModuleGraph.get has to return null when the archive doesn't match the 
mainModule. Part of it wonder if we should remove ArchivedModuleGraph, support 
archiving of the boot layer only.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/16016#discussion_r1375183933

Reply via email to