RFR: 8338716: Re-visit "interrupt handling" in jdk.internal.loader.Resource [v2]

Brent Christian bchristi at openjdk.org
Wed Aug 28 18:35:32 UTC 2024


On Wed, 28 Aug 2024 06:32:44 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   move getContentLength() inside try block
>
> src/java.base/share/classes/jdk/internal/loader/Resource.java line 89:
> 
>> 87:         // can propagate upwards without being caught too early
>> 88:         InputStream in = cachedInputStream();
>> 89:         int len = getContentLength();
> 
> Pre-existing issue but I wonder if this should move into the try block so that the input stream is closed in the event of getContentLength failing.

I agree, that seems like a good idea.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20736#discussion_r1735128133


More information about the core-libs-dev mailing list