On Fri, 17 Apr 2026 13:45:47 GMT, Severin Gehwolf <[email protected]> wrote:
>> David Beaumont has updated the pull request incrementally with two
>> additional commits since the last revision:
>>
>> - Rename ModuleReference to ModuleLink
>> - tweak comments
>
> src/java.base/share/classes/jdk/internal/jimage/PreviewMode.java line 38:
>
>> 36: * to the jimage file provided by the shipped JDK by tools running on
>> JDK 8.
>> 37: * */
>> 38: public enum PreviewMode {
>
> Some users of this enum would be in need of a fourth option: `NONE`. A mode
> that would return the contents of the `jimage` verbatim, preview or not. I
> wonder if `PreviewMode` is the right name.
That's is not how this feature works. The set of values in the enum is correct.
You can't load both the preview class and the non-preview class in the same
runtime. As Alan says, this isn't the same semantics as MR Jars.
Think of it as: If I pass "--enable-preview", I get a completely different
runtime.
There are a couple of subtle ways in which this can be observed to not (quite)
be true, but that's the intent (and we might one days fix the edge cases).
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r3101961781