On Fri, 20 Jun 2025 16:20:37 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java
>>  line 119:
>> 
>>> 117:     public long getContentLengthLong() {
>>> 118:         try {
>>> 119:             return getResourceNode().size();
>> 
>> Having getResourceNode() return the (lazily fetched) node avoids the reader 
>> needing to know/reason about how "connect()" has the side-effect of making 
>> the "resource" field non-null.
>
> It looks like ExplodedImage.PathNode.size() throws UncheckedIOException. That 
> might need mapping back to IOException to get the -1 return consistently.

Done. That's a good spot (I comment it since it's a real gotcha otherwise).

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

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

Reply via email to