Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 68183: SXSSFWorkbook should dispose of temporary files when close() is called #586

Conversation

InfiniteLoop90
Copy link

This way consumers can use the workbook in a try-with-resources statement and the temp files will always be cleaned up without having to remember to explicitly call SXSSFWorkbook#dispose().

@InfiniteLoop90
Copy link
Author

Let me know if there’s anything else needed from me. Thanks!

@centic9
Copy link
Member

centic9 commented Apr 25, 2024

This seems to break some test-cases, can you try to adjust them?

@pjfanning
Copy link
Contributor

  • we can't change this behaviour unless the release is a major release
    • eebb371 and related changes would also probably mean that the next release can't just be patch release (5.2.6)
  • dispose should be deprecated

@InfiniteLoop90 InfiniteLoop90 force-pushed the bug-68183-sxssfworkbook-dispose-temp-files-when-closing-workbook branch 4 times, most recently from 8857c98 to 3db0533 Compare April 26, 2024 22:51
@InfiniteLoop90
Copy link
Author

Thanks for the feedback.

I made the following changes:

  • Changed the TestSXSSFWorkbookWithCustomZipEntrySource#validateTempFilesAreEncrypted test so that it now passes.
  • Added a new test to assert that temp files are disposed of when closing the SXSSFWorkbook without needing to call SXSSFWorkbook#dispose.
  • Deprecated SXSSFWorkbook#dispose.

Ready for re-review when ready. Thanks again.

@InfiniteLoop90 InfiniteLoop90 force-pushed the bug-68183-sxssfworkbook-dispose-temp-files-when-closing-workbook branch from 3db0533 to 9af154d Compare May 5, 2024 14:36
…() is called

This way consumers can use the workbook in a try-with-resources statement and
the temp files will always be cleaned up without having to remember to explicitly
call SXSSFWorkbook#dispose().
@InfiniteLoop90 InfiniteLoop90 force-pushed the bug-68183-sxssfworkbook-dispose-temp-files-when-closing-workbook branch from 9af154d to c7e51fc Compare May 5, 2024 14:38
@asfgit asfgit closed this in 68478c8 May 17, 2024
@pjfanning
Copy link
Contributor

thanks - merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants