[OpenJDK 2D-Dev] 8187898: PrintStream should override FilterOutputStream#write(byte[]) with a method that has no throws clause

Alan Bateman Alan.Bateman at oracle.com
Tue Jul 23 07:45:37 UTC 2019


On 23/07/2019 01:01, Brian Burkhalter wrote:
> :
> This version [1] adds writeBytes() and overrides write(byte[]) without changing its behavior. The documentation of write(byte[]) points the user to writeBytes() and write(byte[],int.int).
>
The overridden write(byte[]) declares that it throws IOE so it's source 
compatible but it behaves like the other PS.write methods in that 
checkError is used to check for an error rather than throwing IOE. This 
will need a bit more wording in the method description to make this 
clearer. The change to the class description is confusing as it suggests 
that the method throws IOE - maybe that change should be dropped to 
avoid trying to explain the oddity in two places.

-Alan.


More information about the core-libs-dev mailing list