RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v4]
Markus KARG
duke at openjdk.org
Sun Dec 17 14:09:41 UTC 2023
On Sat, 16 Dec 2023 19:10:49 GMT, Vladimir Sitnikov <vsitnikov at openjdk.org> wrote:
>> Markus KARG has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Test was using Integer but must use Long
>
> test/jdk/java/io/SequenceInputStream/TransferTo.java line 143:
>
>> 141: SequenceInputStream sis = new SequenceInputStream(is1, is2);
>> 142: OutputStream nos = OutputStream.nullOutputStream();
>> 143: sis.transferTo(nos);
>
> Suggestion:
>
> assertEquals(sis.transferTo(nos), Long.MAX_VALUE, ".transferTo should return Long.MAX_VALUE when transferring more than that amount of bytes");
The intention is not to fully test the complete functionality of `transferTo` but solely to test what *this* PR is fixing. It was never broken that transferTo returned the correct value (that bug never existed), and there is already a test for transferTo contents across streams in place.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17119#discussion_r1429170643
More information about the core-libs-dev
mailing list