poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 64045] XSSFWorkbook constructor doesn't close ZipFile if an exception occurs
Date Fri, 03 Jan 2020 12:17:00 GMT
https://bz.apache.org/bugzilla/show_bug.cgi?id=64045

--- Comment #2 from radistao <radistao@gmail.com> ---
Reviewing the POI sources i found some places which could be considered in the
fix:
1) `PackageHelper#open(InputStream)` (and maybe also `clone()`) is used
directly in `super` and `this` constructor calls for XmlVisioDocument,
XMLSlideShow, XWPFDocument, XSSFWorkbook

2) same for: 
  - POIXMLDocument#openPackage()
  - XSSFWorkbook#newPackage()
  - OPCPackage:
    - open(XXX)
    - openOrCreate(XXX)
    - create(XXXX)

It seems there are a lot of places where `OPCPackage` (or other Closeable local
instances) are wrapped/created and passed as arguments to init methods and
constructor, but not properly handled in case of exceptions.

-- 
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


Mime
View raw message