On Tue, 28 Apr 2026 15:59:11 GMT, Alexey Ivanov <[email protected]> wrote:
>> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 615:
>>
>>> 613: if (i >= size) {
>>> 614: throw new ArrayIndexOutOfBoundsException("Invalid index
>>> (offset+i) is " +
>>> 615: "(" + offset + " + " + i + ") which is too large for
>>> size : " + size);
>>
>> The message is out of sync with a check ` i>=size?`
>
> You're right, the condition should be `(i + offset >= size)`.
fixed
>> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 623:
>>
>>> 621: throw new ArrayIndexOutOfBoundsException("Index cannot be
>>> negative : " + i);
>>> 622: }
>>> 623: if ((offsets[bank] + i) < i) {
>>
>> Should the bank be validated first? or it is assumed always correct in this
>> place?
>
> Yeah, `checkIndex(int bank, int i)` should call `checkBank` first.
fixed
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3155929356
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156028189