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