RFR: 8359808: JavaRuntimeURLConnection should only connect to non-directory resources [v2]
David Beaumont
duke at openjdk.org
Fri Jun 20 11:13:12 UTC 2025
On Fri, 20 Jun 2025 10:55:53 GMT, David Beaumont <duke at openjdk.org> wrote:
>> src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java line 50:
>>
>>> 48: private static final ImageReader READER = ImageReaderFactory.getImageReader();
>>> 49:
>>> 50: // The module and resource name in the URL ("jrt:/<module-name>/<resource-name>").
>>
>> In JEP 220 we use jrt:/[$MODULE[/$PATH]] to make it clear that the resource is optionally.
>
> Well the resource is optional only it the same way that you can given any invalid URL. Connection only works when both a module and a resource name are present.
I updated this and added a direct link to the JEP in the class JavaDoc. It would have been nice if I'd known that when first looking at the class, so it seems right to add it for the next person.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25871#discussion_r2158704307
More information about the net-dev
mailing list