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

Brian Burkhalter brian.burkhalter at oracle.com
Mon Jul 22 15:15:26 UTC 2019


> On Jul 20, 2019, at 9:15 AM, Alan Bateman <Alan.Bateman at oracle.com> wrote:
> 
> On 18/07/2019 16:32, Brian Burkhalter wrote:
>> Resuming this topic, what is the general view on the three possible paths:
>> 
>> 1. Override write(byte[]) at the risk of incompatibility.
>> 2. Instead add writeBytes(byte[]) as in ByteArrayOutputStream.
>> 3. Resolve as Won’t Fix.
>> 
>> For 2 or 3 the incorrect class level statement about overriding all methods not to throw IOE would need to be dealt with.
>> 
> PrintStream dates from JDK 1.0 so I don't think it's feasible to add an override now that doesn't throw IOE.

Agreed.

> Tagir's suggestion to add a writeBytes(byte[]) seem fine, assuming there is a great need.

Not sure of the need but there is the precedent of BAIS.

> Alternatively you can add an override (that throws IOE) so that you have somewhere for an @apiNote that suggests using write(b,0,b.len) as "exception-less" write.

That’s a good idea.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/2d-dev/attachments/20190722/fe59a5e4/attachment.html>


More information about the 2d-dev mailing list