RFR: 8355371: NegativeArraySizeException in print methods in IO or System.console() in JShell
Tatsunori Uchino
duke at openjdk.org
Tue Apr 29 20:56:16 UTC 2025
On Sun, 27 Apr 2025 05:33:48 GMT, Chen Liang <liach at openjdk.org> wrote:
>>> I think the cause is that OutputStream.write(byte[], int, int) provides negative bytes.
>>
>> I seem to recall that perhaps so. Your suggestion is better.
>>
>>> it should be readInt(1).
>>
>> Do you mean `int len = readInt(b);`? I will update it but unfortunately I have no idea which is correct. Do you have any idea to test that the fix is correct?
>> I could not tell the difference in jshell by playing with some input.
>
> Yep, that readInt is probably fine because the buffer is large enough, plus the result is unused, so there was no observable consequence.
>
> Also in principle, we will not approve patches unless oca is cleared; meanwhile please update the 2024 last updated year in the license header of 2 files to 2025. (I thought this rule was mentioned in the guide, but apparently it wasnt!)
~~Which notation is the best?~~
- 2023-2025 (uses the ASCII hypen)
- 2023–2025 (uses U+2013 EN dash)
- 2023, 2024, 2025
Looks like "Copyright (c) A, B" means the the closed interval [A, B] (i.e. A–B).
Is "2023, 2025" correct?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24897#discussion_r2062362164
More information about the kulla-dev
mailing list