On Thu, 12 Nov 2026 05:52:56 GMT, Prasanta Sadhukhan <[email protected]> 
wrote:

>> Phil Race has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   4617681
>
> test/jdk/java/awt/image/BufferedImage/CreateBufferedImageTest.java line 44:
> 
>> 42: 
>> 43:         test(TYPE_CUSTOM, 10); // TYPE_CUSTOM is not a valid parameter.
>> 44:         test(-1, 10);
> 
> Probably we should validate against 0 and -ve dimensions more like
> 
>         { 10, -1 },
>         { 0, 0 },
>         { -1, -1 },
>         { Integer.MIN_VALUE, 10 },
>         { 10, Integer.MIN_VALUE }
> 
> as `BufferedImage.checkDimentions` has added the 0 and -ve check
> {-1, -1} case might be useful because multiplying two negative dimensions 
> produces a positive value which will check that positivity is validated 
> separately..

I don't think it is necessary. The very first line of the constructors  call 
checkDimensions() which immediately checks if either is <=0 .. so

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27640#discussion_r4552738365

Reply via email to