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 Sat, 26 Apr 2025 18:30:04 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.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24897#discussion_r2062255139


More information about the kulla-dev mailing list