[lworld] RFR: 8377162: [lworld] getResourceAsStream() doesn't work in preview mode for exploded images [v2]
David Beaumont
duke at openjdk.org
Tue Feb 17 11:20:02 UTC 2026
On Wed, 4 Feb 2026 15:21:03 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> David Beaumont has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>>
>> - Merge branch 'lworld' into jdk_8377162_exploded_modules/squashed
>> - revert unnecessary filter in ModulePatcher
>> - Latest version
>> - Limit awareness of preview resources to system modules only.
>>
>> * limit preview handling
>> * Patch ModuleReaderTest from mainline
>> - Preview mode for exploded system module readers
>>
>> * with better flag plumbing
>> * Simpler approach with linked hash set
>> * Revert weird import change
>> * First cut at a preview aware module reader for exploded builds
>> * Test for partiy of JRT file-system and class resources in preview mode
>
> src/java.base/share/classes/jdk/internal/module/ModulePath.java line 123:
>
>> 121: * packaged modules. The modules may be patched by the given ModulePatcher.
>> 122: *
>> 123: * <p>This method is deliberately package visible to restrict any use of the
>
> I think it would be better to drop the "is deliberately package visible" comment. The reason the other factory methods are public is that they are accessed from code in other packages.
Done - method is now public.
> src/java.base/share/classes/jdk/internal/module/ModulePath.java line 126:
>
>> 124: * preview mode flag to system modules only.
>> 125: */
>> 126: static ModuleFinder ofSystem(ModulePatcher patcher, boolean previewMode, Path moduleDir) {
>
> I'd prefer name it "of" to be the same as other factory methods.
Done.
> src/java.base/share/classes/jdk/internal/module/ModuleReferences.java line 442:
>
>> 440: collectNames(previewDir, names);
>> 441: }
>> 442: return names.stream();
>
> The first walk will find all resources in the module, include resources in META-INF/preview, irrespective of whether preview features is enabled.
Ahh yes thanks, I've filtered those out now. The 2nd walk is needed because the *names* are directory relative and you can get new entries which only exist in the preview directory.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2032#discussion_r2816478814
PR Review Comment: https://git.openjdk.org/valhalla/pull/2032#discussion_r2816477355
PR Review Comment: https://git.openjdk.org/valhalla/pull/2032#discussion_r2766200061
More information about the valhalla-dev
mailing list