On Tue, 16 Jun 2026 13:08:12 GMT, Chen Liang <[email protected]> wrote:
>> src/java.base/share/classes/jdk/internal/jrtfs/ExplodedImage.java line 149:
>>
>>> 147: private byte[] getContent() throws IOException {
>>> 148: if (!getFileAttributes().isRegularFile())
>>> 149: throw new FileSystemException(getName() + " is not a
>>> resource");
>>
>> The original exception message was correct, it should say "file" or "regular
>> file".
>
> This guy is only called from `SystemImage::getResource`, and the other
> implementation reports "not a resource" when it fails:
> https://github.com/openjdk/valhalla/blob/2523a4f43c8d865574693fff3a8944b2c1c64fe8/src/java.base/share/classes/jdk/internal/jimage/ImageReader.java#L788
The exploded image doesn't have a jimage file. Also file system APIs (that
jrtfs implements) speaks of files rather than resources.
A jlink generated run-time image has a jimage file. Some APIs built on that,
e.g. Class::getResource, maps resource names to entries. The jrtfs
implementation for the run-time image speaks files.
-------------
PR Review Comment:
https://git.openjdk.org/valhalla/pull/2545#discussion_r3421029986