RFR: 4799358: BufferOutputStream.write() should immediately throw IOExcept on closed stream [v2]
Alan Bateman
alanb at openjdk.org
Thu Aug 24 06:39:28 UTC 2023
On Thu, 24 Aug 2023 04:24:21 GMT, Vyom Tewari <vtewari at openjdk.org> wrote:
> I am unable to understand how proposed change breaks longstanding behavior(what behavior). With current implementation if the underline stream is closed ‘BufferedOutputStream.write’ will throw IOException when the internal buffer is full. With the proposed change BufferedOutputStream will throw IOException immediately.
The change means that IOException will be thrown for cases where it isn't currently thrown. It also means that IOException may be thrown at different use-sites that it is now. I don't think anyone is disagreeing that there is a long standing bug, the issue is that changing the behavior will likely be observed. In cases like this, we will often decide to just specify long standing behavior as the compatibility impact of fixing something is too high.
In this case, I don't object to fixing it early in JDK 22 but the change will need to be widely tested so as to shake out any bugs in code in the eco system as early as possible. It might be that after a few weeks/months that we get some confidence that it is okay, or it might be that we decide to introduce a system property to restore long standing behavior, or decide to just back it out. The question is whether we can get enough testing of JDK 22 builds to help decide on this.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15361#issuecomment-1691087377
More information about the core-libs-dev
mailing list