On Fri, 12 Jun 2026 15:07:36 GMT, Alan Bateman <[email protected]> wrote:

> The changes to the module system to allow the JDK exploded image support 
> preview features needs a new cleanups. All relatively simple:
> 
> - the factory method to create ModuleFinder that locates modules in a JDK 
> exploded image is renamed as this is not like the module path specified to 
> the java launcher or jlink tool.
> - the ModuleReader for the exploded image is shouldn't be checking that a 
> resource exists twice.
> - the ModuleReader::list method does not need to collect all resources when 
> preview features are disabled or the module does not have any preview classes
> - Some cleanups to the test. assertUtf8Resource is renamed to testReader as 
> it's really testing all the module reader methods. Fixed some resource leaks 
> and reverted a few random format/comment changes that are nothing to do with 
> the changes in the branch.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

The module reader cleanup looks good. I assume the cleanup for jrt file 
system's exploded image preview support will be in a separate patch.

src/java.base/share/classes/jdk/internal/module/ModuleReferences.java line 474:

> 472:                                            Set<String> names) throws 
> IOException {
> 473:             try (Stream<Path> files = Files.walk(root, 
> Integer.MAX_VALUE)) {
> 474:                 files.skip(1)

Let's add a 
Suggestion:

                files.skip(1)  // skip root

comment here.

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

Marked as reviewed by liach (Committer).

PR Review: 
https://git.openjdk.org/valhalla/pull/2540#pullrequestreview-4489258223
PR Review Comment: 
https://git.openjdk.org/valhalla/pull/2540#discussion_r3406287199

Reply via email to