Mikkey-f commented on code in PR #1034:
URL: https://github.com/apache/fesod/pull/1034#discussion_r3838785096
##########
fesod-sheet/src/main/java/org/apache/fesod/sheet/write/metadata/holder/WriteWorkbookHolder.java:
##########
@@ -240,12 +240,15 @@ public WriteWorkbookHolder(WriteWorkbook writeWorkbook) {
}
// init handler
- initHandler(writeWorkbook, null);
-
try {
+ initHandler(writeWorkbook, null);
copyTemplate();
} catch (IOException e) {
+ closeOutputStreamIfOwned();
Review Comment:
Thanks for the suggestion — updated. The failure path in
`WriteWorkbookHolder` now gates the close on `autoCloseStream` instead of `file
!= null`, which mirrors the success-path behavior. Callers using
`autoCloseStream(false)` keep their streams unclosed on failure as well, and
the test now sets `autoCloseStream(false)` explicitly to assert that contract.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]