On Mon, 27 Apr 2026 20:20:26 GMT, Sergey Bylokhov <[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/DataBufferFloat.java line 255:
> 
>> 253:      * @throws ArrayIndexOutOfBoundsException if {@code bank} is not a 
>> valid bank index.
>> 254:      */
>> 255:     public float[] getData(int bank) {
> 
> It looks like getData(int bank) in all classes are not covered by the tests?

I've added something to the Element test.

> src/java.desktop/share/classes/java/awt/image/DataBufferFloat.java line 369:
> 
>> 367:      * @return The data entry as a {@code float}.
>> 368:      * @throws ArrayIndexOutOfBoundsException if {@code bank} is not a 
>> valid bank index,
>> 369:      *         or {@code (i + getOffsets(bank))} is not a valid index 
>> into the bank.
> 
> For `public void setElem(int bank, int i, int val) { ` above it is documented 
> as:
> `or {@code (i + getOffsets()[bank])} is not a valid index into the bank`

fixed

> test/jdk/java/awt/image/DataBuffer/DataBufferGetSetElemTest.java line 66:
> 
>> 64:             test(dbu, size);
>> 65:             test(dbu, -1);
>> 66:             dbu = new DataBufferShort(buf, size-1, 1);
> 
> Should be "DataBufferUShort"?

fixed

> test/jdk/java/awt/image/DataBuffer/DataBufferGetSetElemTest.java line 117:
> 
>> 115:         }
>> 116:         try {
>> 117:             db.getElem(1, index);
> 
> should we cover invalid/valid bank together with valid/invalid index?

I've added more tests.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156492487
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156221308
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156230555
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3156489218

Reply via email to