FilterOutputStream.close() throws exception from flush() (original) (raw)

Alan Bateman 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?

Regards, Alex. 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 [1] 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.

-Alan

[1] http://mail.openjdk.java.net/pipermail/core-libs-dev/2011-August/007326.html



More information about the core-libs-dev mailing list