[9] RFR of 8042377: BufferedWriter and FilteredOutputStream.close throw IAE if flush and close throw equal exceptions
Alan Bateman
Alan.Bateman at oracle.com
Fri Jun 26 08:22:11 UTC 2015
On 26/06/2015 09:17, Peter Levart wrote:
> :
>
>
> Quite the contrary, previously, if flush() threw any unchecked
> exception (ThreadDeath included), it was ignored if out.close() also
> threw (IOException or any unchecked exception).
Yes, this is what I was trying to say.
>
>
>
> + // evaluate possible precedence of
> flushException over closeException
> + if ((flushException instanceof ThreadDeath) &&
> + !(closeException instanceof ThreadDeath)) {
> + flushException.addSuppressed(closeException);
> + throw (ThreadDeath) flushException;
> + }
That would be better and would deal with the concern with webrev.02.
-Alan
More information about the core-libs-dev
mailing list