RFR: 8359808: JavaRuntimeURLConnection should only connect to non-directory resources [v4]

Alan Bateman alanb at openjdk.org
Tue Jun 24 15:52:48 UTC 2025


On Tue, 24 Jun 2025 15:42:06 GMT, David Beaumont <duke at openjdk.org> wrote:

>> src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java line 113:
>> 
>>> 111:     public long getContentLengthLong() {
>>> 112:         // Note: UncheckedIOException is thrown by the Node subclass in
>>> 113:         // ExplodedImage (this not obvious, so worth calling out).
>> 
>> This protocol handler is for images build, not exploded builds. ImageReaderFactory.getImageReader will fail if you attempt it with an exploded build. So I don't think we need this comment or the catch of UIOE.
>
> Roger suggested I add the catch for the `UncheckedIOException` because of it. Maybe chat with him to see if this could somehow end up seeing an ExplodedImage build?

@RogerRiggs The jrt protocol handler is for images builds. Any attempt, in exploded build, to connect to a jrt resource will blow up as ImageReaderFactory.getImageReader fails.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25871#discussion_r2164369527


More information about the net-dev mailing list