RFR: 8321053: Use ByteArrayInputStream.buf directly when parameter of transferTo() is trusted [v4]

Alan Bateman alanb at openjdk.org
Tue Dec 5 08:29:36 UTC 2023


On Tue, 5 Dec 2023 07:37:39 GMT, Markus KARG <duke at openjdk.org> wrote:

>> Brian Burkhalter has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8321053: instanceof -> ==
>
> src/java.base/share/classes/java/io/ByteArrayInputStream.java line 213:
> 
>> 211:             byte[] tmp;
>> 212:             Class<?> outClass = out.getClass();
>> 213:             if (outClass.getPackageName().equals("java.io") &&
> 
> For what do we need this string-based check here?

I suspect it's left over from a previous iteration. In any case, limiting it to a small number of output streams makes this easier to look at. BAOS and FOS seem okay, POP seems okay too but legacy and not interesting.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16893#discussion_r1415121241


More information about the core-libs-dev mailing list