On Tue, 21 Apr 2026 10:35:58 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 169:
> 
>> 167:      *  @param numBanks the number of banks in this
>> 168:      *         {@code DataBuffer}
>> 169:      *  @throws IllegalArgumentException if {@code size} or {@code 
>> numBanks} is less than or equal to zero.
> 
> I like the new condition better because it's symmetrical.
> 
>> ```java
>>      * @throws IllegalArgumentException if {@code size} is less than or 
>> equal to zero,
>>      *         or {@code numBanks} is less than one.
>> ```
> 
> The line is too long, it's longer than *100 chars*.

line split

> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 228:
> 
>> 226:      *         {@code DataBuffer}
>> 227:      *  @param offset the offset for each bank
>> 228:      *  @since 1.7
> 
> Usually, `@since` is the last statement in javadoc. Other constructors follow 
> this convention.

reordered

> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 287:
> 
>> 285:      *  @throws IllegalArgumentException if any element of {@code 
>> offsets} is less than zero.
>> 286:      *  @throws ArrayIndexOutOfBoundsException if {@code numBanks}
>> 287:      *          does not equal the length of {@code offsets}
> 
> Would it be better to amend the condition for ArrayIndexOutOfBoundsException 
> so that they match between `DataBuffer` and its subclasses?
> 
> 
>      * @throws ArrayIndexOutOfBoundsException if the lengths of {@code 
> dataArray}
>      *          and {@code offsets} differ.

I don't think it necessary. The subclasses take an array, not an int, so it 
isn't an identical situation.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3119699549
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3119704584
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3119779960

Reply via email to