RFR: 8320971: Use BufferedInputStream.buf directly when param of implTransferTo() is trusted [v18]

Sergey Tsypanov stsypanov at openjdk.org
Thu Dec 28 15:09:10 UTC 2023


On Sat, 23 Dec 2023 13:08:06 GMT, Markus KARG <duke at openjdk.org> wrote:

>> Sergey Tsypanov has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   8320971: Fix test
>
> test/jdk/java/io/BufferedInputStream/TransferToTrusted.java line 83:
> 
>> 81:                 var internalBuffer = bis.getClass().getDeclaredField("buf");
>> 82:                 internalBuffer.setAccessible(true);
>> 83:                 if (!Arrays.equals(buf, Arrays.copyOf((byte[]) internalBuffer.get(bis), length))) {
> 
> This is not testing the absence of a copy.

Yeah, but how could I intercept the argument of OutputStream.write() and check it's identity?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16879#discussion_r1435682191


More information about the core-libs-dev mailing list