RFR: JDK-8294702 - BufferedInputStream uses undefined value range for markpos

Alan Bateman alanb at openjdk.org
Tue Oct 4 06:58:54 UTC 2022


On Mon, 3 Oct 2022 07:29:02 GMT, Markus KARG <duke at openjdk.org> wrote:

> Fixes JDK-8294702

src/java.base/share/classes/java/io/BufferedInputStream.java line 546:

> 544:     private void implReset() throws IOException {
> 545:         getBufIfOpen(); // Cause exception if closed
> 546:         if (markpos == -1)

Just looking at this one again and it might be better to not change implReset. If a broken subclass were to set markpos to less than -1 then the reset() method would throw and avoid a more confusing IIOOBE or other exception.

-------------

PR: https://git.openjdk.org/jdk/pull/10528


More information about the core-libs-dev mailing list