On Tue, 28 Apr 2026 16:01:03 GMT, Alexey Ivanov <[email protected]> wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   8377568
>
> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 632:
> 
>> 630:             throw new ArrayIndexOutOfBoundsException("Invalid index 
>> (offsets[" + bank + "]+i) is " +
>> 631:                 "(" + offsets[bank] + " + " + i + ") which is too large 
>> for size : " + size);
>> 632:         }
> 
> The condition here should be `(i + offsets[bank] >= size)`.

fixed

> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 632:
> 
>> 630:             throw new ArrayIndexOutOfBoundsException("Invalid index 
>> (offsets[" + bank + "]+i) is " +
>> 631:                 "(" + offsets[bank] + " + " + i + ") which is too large 
>> for size : " + size);
>> 632:         }
> 
> I wonder whether the messages in the exceptions should use `getOffset()` or 
> `getOffsets()` instead of member variables `offset` and `offsets`.

Either is sufficient.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156137079
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156141084

Reply via email to