On Fri, 27 Mar 2026 15:07:53 GMT, Alan Bateman <[email protected]> wrote:

>> David Beaumont has updated the pull request with a new target base due to a 
>> merge or a rebase. The pull request now contains 12 commits:
>> 
>>  - Merge branch 'master' into jimage_preview_mode
>>  - rename jimage_exists to jimage_is_open
>>  - Feedback tweaks
>>  - Feedback tweaks
>>  - More feedback tweaks
>>  - Updated copyright
>>  - Feedback changes
>>  - Merge branch 'master' into jimage_preview_mode
>>  - Merge branch 'master' into jimage_preview_mode
>>  - undo exploded image changes for now
>>  - ... and 2 more: https://git.openjdk.org/jdk/compare/7695b1f9...0e802079
>
> src/java.base/share/classes/jdk/internal/jimage/PreviewMode.java line 80:
> 
>> 78:                          InvocationTargetException e) {
>> 79:                     // But if the class exists, the method must exist 
>> and be callable.
>> 80:                     throw new AssertionError(e);
> 
> It's unfortunate that it has to use reflection here but there is precedent as 
> BasicImageReader and ImageReaderFactory are forced to do the same. An 
> alternative would of course to have a different version to include in 
> jrt-fs.jar that does not have the dependency. 
> 
> It can't happen but the default case is probably InternalError (can't happen) 
> rather than IllegalStateException.

I switched to InternalError.

> src/java.base/share/classes/jdk/internal/jimage/ResourceEntries.java line 33:
> 
>> 31:  *
>> 32:  * <p>This API is designed only for use by the jlink classes, which read 
>> the raw
>> 33:  * jimage files. Use the {@link ImageReader} API to read jimage contents 
>> at
> 
> "read the raw jimage files" is confusing as there is only one jimage file 
> that the jlink tool generates. Is the comment about the "jimage" tool rather 
> than "jlink" tool?

It's used by JRTArchive, which is used by `linkableRuntimeImage` in `JlinkTask`.
This needs to read resources "raw" without reference to preview mode.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r3008582565
PR Review Comment: https://git.openjdk.org/jdk/pull/29414#discussion_r3008571223

Reply via email to