On Tue, 16 Aug 2022 06:26:24 GMT, Alan Bateman <[email protected]> wrote:
>> Not sure about this one? `fill()` is specified to throw an `IOException` and >> `EOFException` is an `IOException`. It probably depends on how you interpret >> the current "*if an I/O error has occurred*" description in the throws >> section. >> >> Do you propose to be more specific there and write something like "*if an >> I/O error has occurred or the end of the input buffer has been reached*"? > >> Not sure about this one? `fill()` is specified to throw an `IOException` and >> `EOFException` is an `IOException`. It probably depends on how you interpret >> the current "_if an I/O error has occurred_" description in the throws >> section. >> >> Do you propose to be more specific there and write something like "_if an >> I/O error has occurred or the end of the input buffer has been reached_"? > > Like many JDK 1.1 era APIs, InflaterInputStream is very under-specified. In > this case, the protected fill method is begging us to specify how it behaves > when the input is at EOF. An I/O error is surprising here as it also sets the > protected len field to indicate EOF. We can't change it after 25 years so we > will need to specify existing behavior. OK, I've opened [JDK-8292427: Improve specification of InflaterInputStream.fill()](https://bugs.openjdk.org/browse/JDK-8292427) to track this. ------------- PR: https://git.openjdk.org/jdk/pull/9881
