https://bz.apache.org/bugzilla/show_bug.cgi?id=59634

            Bug ID: 59634
           Summary: XSSFWorkbook#close() violates contract from
                    Workbook#close()
           Product: POI
           Version: 3.14-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: michael.holterm...@dfb-medien.de

Created attachment 33890
  --> https://bz.apache.org/bugzilla/attachment.cgi?id=33890&action=edit
TestCase demonstrating the issue

According to Workbook#close() it should not have any effect on newly created
workbooks.

This is true for HSSFWorkbooks.

For XSSFWorkbooks it's not possible to write the document to an OutputStream
after calling #close().

Since I'm mostly creating Workbooks from scratch, I thought I can call #close()
just after creation of Worbook, instead of somewhere later when the document
was written to outside world.

Please see the attached test case that should demonstrate the issue.


(Side note: The documentation states #close() will close the underlying input
resource the Workbook was created from (e.g. calls to constructor
HSSFWorkbook(InputStream)?). Shouldn't be the creator of that InputStream
responsible for closing that Stream?)

Regards,
Michael

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

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

Reply via email to