[lworld] RFR: 8377162: [lworld] getResourceAsStream() doesn't work in preview mode for exploded images [v2]
Alan Bateman
alanb at openjdk.org
Thu Feb 19 18:57:18 UTC 2026
On Thu, 19 Feb 2026 18:05:40 GMT, David Beaumont <duke at openjdk.org> wrote:
>> Oh blimey, how did I not think to add `-esa -ea`. Thank you for spotting.
>> I did rename methods in the last push and update the test description. I'll see if further rewording is worth it based on this comment thread.
>
> My use of "default runtime" was to distinguish it from opening other jimage files via URI, which wouldn't be expected match the runtime classes.
>
> Instead of "JrtFileSystemClassParityTest" how about "ClassResourcesParityTest".
>
> Having preview in the name is a bit odd to me, since in one invocation it's not using preview mode.
>
> Also, it does need to translate the IOException because it's called as a lambda via a method reference.
Can you try changing the test descriptions so that the first run uses:
@test id=no-enable-preview
@requires !java.enablePreview
and the second run uses:
@test id=enable-preview
@enablePreview
I haven't tested it but it should mean the first run isn't selected when testing with preview features enabled (avoids adding it to ProblemList-enable-preview.txt). The second will avoid needing to explicitly use --enable-preview.
ClassResourcesParityTest is probably okay in the sense that it tests that the resource lookup will locate the same class bytes as class loading .
I think drop "default runtime" from the description as it hints of alternatives or some other install. The test will use the JDK under test, and this test exercises the file system view of this runtime. There is nothing images or exploded build specific.
-------------
PR Review Comment: https://git.openjdk.org/valhalla/pull/2032#discussion_r2829607591
More information about the valhalla-dev
mailing list