On Tue, 2 Jun 2026 07:54:57 GMT, Alan Bateman <[email protected]> wrote:
>> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImageResourcesTree.java
>> line 252:
>>
>>> 250: parentNode =
>>> getDirectoryNode(resPath.substring(i + 1, j), parentNode);
>>> 251: }
>>> 252: new ResourceNode(resPath.substring(pathEnd + 1),
>>> parentNode);
>>
>> @AlanBateman It appears we might still need the logic we have at
>> line#285-293?
>>
>> String resourceName = resPath.substring(pathEnd + 1);
>> Node resourceNode = parentNode.getChildren(resourceName);
>> if (resourceNode == null) {
>> new ResourceNode(resourceName, parentNode);
>> } else if (!(resourceNode instanceof ResourceNode)) {
>> throw new InvalidTreeException(resourceNode);
>> }
>>
>> otherwise we might mishandle the bad input like
>>
>> /modfoo/META-INF/foo/bar.properties
>> /modfoo/META-INF/foo
>
> Can you construct a test to demonstrate what you mean? For
> `/modfoo/META-INF/foo/bar.properties` it should construct a resource node for
> "bar.properties" with "foo" as the parent and just. But maybe you mean
> resources in META-INF/preview ?
@AlanBateman I'm fine with getting David's original fix in as-is for 27 for
now.
The proposed fix for the above mentioned issue is
https://cr.openjdk.org/~sherman/8385355-2/
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/31318#discussion_r3346742922