On Tue, 2 Jan 2024 08:35:47 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

> This call has a potential to throw an `IOException` in which case any 
> original `IOException` thrown from the `finish()` call will be lost.

Good catch. Adopted your suggestion with a few changes:

- The catch for IOException during finish() needs to rethrow the exception
- The catch for IOException during close() needs to check that finishException 
!= ioe, otherwise addSuppressed may throw IAE, see 
https://bugs.openjdk.org/browse/JDK-8042377
- I renamed finishFailure to finishException

The above changes were inspired by the overridden method 
`FilterOutputStream.close()`

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17209#discussion_r1439265718

Reply via email to