On Tue, 1 Jul 2025 19:54:10 GMT, David Beaumont <[email protected]> wrote:
>> src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java
>> line 456:
>>
>>> 454: Optional<ImageReader.Node> node =
>>> Optional.ofNullable(reader.findNode(nodeName));
>>> 455: if (node.isPresent() && !node.get().isResource()) {
>>> 456: throw new IllegalStateException("Not a resource node:
>>> " + node.get());
>>
>> The IllegalStateException is problematic here, maybe you mean to add an
>> assert?
>
> This is called externally so cannot trust the given name really references a
> resource.
> I can't therefore make it an assertion, but I can just return empty if it
> didn't point at a resource (even if it did point at a directory etc.). Or I
> can make it an Error.
I made it return empty for now and documented it as such.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/26054#discussion_r2178467594