RFR: JDK-8322141: SequenceInputStream.transferTo should not return as soon as Long.MAX_VALUE bytes have been transferred [v3]

Markus KARG duke at openjdk.org
Sat Dec 16 14:07:56 UTC 2023


On Sat, 16 Dec 2023 07:02:57 GMT, Vladimir Sitnikov <vsitnikov at openjdk.org> wrote:

>> Markus KARG has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   New test asserts subsequent input stream is read when preceding stream already was MAX_VALUE long.
>
> test/jdk/java/io/SequenceInputStream/TransferTo.java line 160:
> 
>> 158:                 pos++;
>> 159:                 return b;
>> 160:             }
> 
> To trigger the problematic case, we need to transfer more than `Long.MAX_VALUE`. `Integer.MAX_VALUE` is not enough, and we need nearly `Integer.MAX_VALUE * Integer.MAX_VALUE` bytes to trigger the problematic case which might take noticeable time.
> 
> I think the easiest way would be overriding `transferTo(...)` in a mock `InputStream` so it returns `Long.MAX_VALUE`, and adding that stream in a sequence.

I know and the solution is already in progress (see my last comment from yesterday). Stay tuned.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/17119#discussion_r1428746194


More information about the core-libs-dev mailing list