RFC: 8132359: JarURLConnection.getJarFile() resource leak when file is not found

Michael McMahon michael.x.mcmahon at oracle.com
Mon May 11 13:28:20 UTC 2020


On 10/05/2020 21:51, Alex Kashchenko wrote:
> Thanks for your comments!
>
> On 05/08/2020 06:38 PM, Michael McMahon wrote:
>>
>> [...]
>>
>>>> https://bugs.openjdk.java.net/browse/JDK-8244650
>>>
>>> I believe some sort of spec change will be needed, if only to justify
>>> challenging the JCK. Currently, the proposed change trips the following
>>> test:
>>>
>>> TestCase: [JarURLConnectionT216] FAIL->getManifest() did not throw 
>>> expected IOException for 
>>> jar:file:/JCK-runtime-15/tests/api/java_net/JarURLConnection//jardir/T11.jar!/NOJARENTRY.class 
>>
>
> I've added a reference to this failure to "Compatibility Risk 
> Description".
>
I think for the avoidance of doubt we should make the same change to the 
getManifest() @Throws spec also,
to cover the above. There is another method getMainAttributes() whose 
behavior will also change,
but I think its existing spec covers it, since it depends on getManifest()

- Michael

>
>>>
>>> [...]
>>>
>> I agree. Even though the @throws appears to say an IOException is 
>> only thrown
>>
>> if the connection to the JAR file fails, I think we should make it 
>> more explicit.
>
> Updated "Specification" part including the changes to the API spec.
>
>
>>
>> [...]
>>
>


More information about the net-dev mailing list