[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 Andreas Beeker changed: What|Removed |Added Status|NEEDINFO|NEW --- Comment #8 from Andreas Beeker --- This closing habbit already annoyed me several times and I've actually added a fix via r1832746 Just have a look at [1] this closing is simply confusing. Furthermore if you write a file backed OPC-Document to a different file, the original file gets also modified [2]. We should really fix this for 4.0.0. [1] https://stackoverflow.com/questions/50646538/stream-close-exception-occures [2] https://stackoverflow.com/a/50830215/2066598 -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 Dominik Stadlerchanged: What|Removed |Added Severity|normal |enhancement -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #7 from Greg Woolsey--- I'm also in favor of a helper method, to avoid a dramatic change to the API. Big breaks in backward compatibility mean longer delays before downstream projects taken an update, and often I want newer functionality available to my projects that use those downstream projects sooner rather than later. Maintaining backward compatibility speeds that up, or lets me update POI independent of other libraries. -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #6 from Nick Burch--- We already have a helper method on NPOIFS for people who don't want the auto-close behaviour when opening from an InputStream - https://poi.apache.org/apidocs/org/apache/poi/poifs/filesystem/NPOIFSFileSystem.html#createNonClosingInputStream(java.io.InputStream) Maybe we could add a similar one for OutputStream, to help people wrap their problematic ones if needed? -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #5 from Dominik Stadler--- I agree, it sounds like a theoretical issue and changing this very likely would have bad side-effects for existing users. -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 Javen O'Nealchanged: What|Removed |Added Status|NEW |NEEDINFO --- Comment #4 from Javen O'Neal --- ddchzyj99, what kind of OutputStream are you using that has problems being closed twice? I think we may want to err on the side of no change unless someone has a nonhypothetical scenario where this impacts them. -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #3 from Javen O'Neal--- There should only be a problem if the OutputStream's close method follows the AutoCloseable interface and is not idempotent, where subsequent calls to close have visible side effects. At the creation of these classes and prior to Java 7, OutputStream implemented the Closeable interface, which requires subsequent calls to close to have no effect. We must balance that with users forgetting to close their own input streams and leaking resources (though that's on them). If we change POI to no longer close user-opened OutputStreams, we should document this changed behavior in both the Javadocs and changelog, making sure to update all of our POI example code and website to close the provided stream (that'd be a good idea anyways). https://docs.oracle.com/javase/7/docs/api/java/io/OutputStream.html#close() -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #2 from Nick Burch--- I believe that all the write methods should be closing the streams, because once POI has finished writing to the File / Stream, there's nothing more that can be done to them. All the file formats are write-once only, none of them support subsequent appending. -- 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
[Bug 60713] SXSSFWorkbook.write(OutputStream) close OutputStream
https://bz.apache.org/bugzilla/show_bug.cgi?id=60713 --- Comment #1 from Javen O'Neal--- That's a good point--whatever opens a stream should be responsible for closing it. However, you may have problems with corrupt workbooks if you cat two workbooks together, so I don't see this as a real use case. -- 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