FilterOutputStream.close() throws exception from flush()
Alan.Bateman at oracle.com
Fri Feb 10 13:46:48 UTC 2012
On 10/02/2012 13:09, Alex Lam S.L. wrote:
> Hi there,
> I have some code which calls FilterOutputStream.close(), which calls
> the underlying OutputStream.flush() which throws IOException.
> With previous versions of JavaSE, close() returns successfully without
> any problems.
> Using JDK8-b24, I get an IOException which is propagated from flush().
> Is there any reason for this change in behaviour?
This was deliberate change as FilterOutputStream.close was silently
ignoring the exception from the flush (a serious bug in my view). In the
original discussion  I noted that we may have to consider a
compatible switch in the event that it causes problems for applications
that don't expect close to fail. You may be the first.
More information about the core-libs-dev