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

--- Comment #2 from Dominik Stadler <dominik.stad...@gmx.at> ---
For dicussion, the current javadoc for Workbook.close() is

     * Close the underlying input resource (File or Stream),
     *  from which the Workbook was read. After closing, the
     *  Workbook should no longer be used.
     * <p>This will have no effect newly created Workbooks.

HSSFWorkbook.close()

     * Closes the underlying {@link NPOIFSFileSystem} from which
     *  the Workbook was read, if any. Has no effect on Workbooks
     *  opened from an InputStream, or newly created ones.

XSSFWorkbook.close()

     * Closes the underlying {@link OPCPackage} from which this
     *  document was read, if there is one

We should probably rephrase those to state more in the order of "do not use at
all after closing" and "it will close resources that have been passed in the
constructor". This makes it as simple as possible and does not lead to very
hard to find bugs if passed in resources are closed at some point.

This way would also be consistent with what many other Java-Closeable-instances
will do when they receive some resource themselves, e.g. see
FileInputStreamReader, FileOutputStreamWriter, ...

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