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

David Beaumont duke at openjdk.org
Mon Jun 23 11:12:32 UTC 2025


On Mon, 23 Jun 2025 11:01:02 GMT, David Beaumont <duke at openjdk.org> wrote:

>> src/java.base/share/classes/sun/net/www/protocol/jrt/JavaRuntimeURLConnection.java line 60:
>> 
>>> 58: 
>>> 59:     // The resource node (when connected).
>>> 60:     private volatile Node resourceNode;
>> 
>> Did you mean to keep this as a volatile field? The only access right seems to be in the synchronized getResourceNode method but maybe it was accessed without the lock in a previous version?
>
> Yeah, I can't see any reason to keep this, but didn't want to risk touching it.
> If you are happy to remove it, I will be happy to do so (I don't like unexplained/uncommented things like this).

I removed it. It really can't be making any difference.

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

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


More information about the net-dev mailing list