RFR JDK-8037394: ZipFileSystem leaks file descriptor when file is not a valid zip file

Xueming Shen xueming.shen at oracle.com
Thu Jan 22 20:15:44 UTC 2015


webrev has been updated to suppress the possible exception...

http://cr.openjdk.java.net/~sherman/8037394

thanks!
-Sherman

On 01/22/2015 11:30 AM, Alan Bateman wrote:
> On 22/01/2015 19:14, Xueming Shen wrote:
>> Hi, please help review the changeset for
>>
>> issue: https://bugs.openjdk.java.net/browse/JDK-8037394
>> webrev: http://cr.openjdk.java.net/~sherman/8037394
>>
>> I'am not including a test case since it basically tests to run out of the
>> fd of that process...but I did reproduce the problem and verify the fix.
>>
>> I also changed the implementation to throw a normal ZipException instead
>> of the "ZipError" (which is an internal vm error). It appears inappropriate
>> for the FileSystems.newFileSystem() to throw a vm error exception in case
>> a dedicated fs provider fails to handler the target file. The ZipError is a
>> leftover/copyover from the j.u.zip implementation.
> Yes, ZipException is better here.
>
> The changes looks okay. A small improvement would be to catch the exception from ch.close and add it to x as a suppressed exception.
>
> -Alan



More information about the nio-dev mailing list