poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 60128] File left open in ZipPackage when InvalidFormatException are raised
Date Wed, 14 Sep 2016 13:07:25 GMT

--- Comment #2 from Javen O'Neal <onealj@apache.org> ---
I found a couple spots where opened files were not closed when raising
exceptions. The one mentioned in comment 0, caused by OPCPackage.open not
closing the ZipPackage when pack.getParts() failed is fixed [1].
I found some other cases in the ZipPackage constructors that could fail without
cleaning up their resources. [2]

I committed these changes in r1760702. They will likely be included in the POI
3.15 final release.

This commit is in desperate need of cleanup for someone who knows what they're
doing with Java exception handling. This is admittedly beyond my skills.

Thanks for the test file, code, and stack trace. Got any ideas how we can check
for unclosed resources in our unit tests? In TestZipPackage, we're using
assertTrue(tmpFile.delete()) [3]

[1] OPCPackage.java
[2] ZipPackage.java
[3] TestZipPackage.java

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message