[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 15 17:14:35 UTC 2019

Here is an alternative version which adds a writeBytes(byte[]) method instead of overriding write(byte[]):

http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/ <http://cr.openjdk.java.net/~bpb/8187898/webrev-alt.00/>

This has the advantage of allowing new code to call writeBytes() without a try-catch block without introducing a compatibility issue for code which is already calling write(byte[]) in a try-catch block.



> On Jul 15, 2019, at 9:00 AM, Brian Burkhalter <brian.burkhalter at oracle.com> wrote:
>> On Jul 13, 2019, at 12:00 PM, Tagir Valeev <amaembo at gmail.com <mailto:amaembo at gmail.com>> wrote:
>> And whilst great you are fixing up this code, we are but a small fraction of the world's code
>> that use java.io <http://java.io/> and I wonder if this is worth the compatibility risk ?
>> Why not introducing a separate writeBytes method like it was done for ByteArrayOutputStream (JDK-8199713)?
> Actually that seems like a better idea: accomplishes the objective while not introducing a compatibility issue. Note: JDK 8199713 reference above is the CSR of the actual issue [1].
> Thanks,
> [1] https://bugs.openjdk.java.net/browse/JDK-8180410 <https://bugs.openjdk.java.net/browse/JDK-8180410>

More information about the core-libs-dev mailing list