On Thu, 30 Apr 2026 19:03: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 613:
> 
>> 611:                 "(" + offset + " + " + i + ") = " + (offset + i));
>> 612:         }
>> 613:         if (i >= size) {
> 
> Does it make sense to add a similar comment here?
> 
> 
>         // Don't need to include bank offset here since all constructors 
> validated
>         // the offset for each bank against the size.
> 
> 
> To avoid the confusion, that `offset` is missed. However, it could be not a 
> problem any more because the exception message doesn't mention _`offset`_ now.

The one place was enough.

> src/java.desktop/share/classes/java/awt/image/DataBuffer.java line 653:
> 
>> 651:         if (numBanks <= 0) {
>> 652:             throw new IllegalArgumentException("Must have at least one 
>> bank");
>> 653:         }
> 
> Suggestion:
> 
>         if (numBanks < 1) {
>             throw new IllegalArgumentException("Must have at least one bank");
>         }
> 
> The condition will literally match the exception message.

It is fine as it is.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3170735067
PR Review Comment: https://git.openjdk.org/jdk/pull/29766#discussion_r3170739002

Reply via email to