On Wed, 3 Dec 2025 23:11:13 GMT, Phil Race <[email protected]> wrote:

>> Specifying the behaviour of BufferedImage constructors for invalid 
>> dimensions is long overdue.
>> 
>> The behaviour for image types and sizes <= 0 is unchanged by this PR.
>> Also in many cases the behaviour for sizes that are too large is also 
>> unchanged.
>> In some cases, the behaviour is changed from "accidental" 
>> NegativeArraySizeException to a consistent IllegalArgumentException.
>> 
>> In no case is anything changed that would affect the possibility to 
>> construct a BufferedImage.
>> 
>> A test is provided to ensure the behaviour.
>> 
>> A CSR is provided too : https://bugs.openjdk.org/browse/JDK-8369155
>
> Phil Race has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   4617681

It has taken me a lot longer than I anticipated to get back to this.
I've revised the text quite substantially, adding explanatory material.
And despite the unlikelihood of the implementation changing to use 
BandedSampleModel for any of the existing pre-defined types to which it can 
apply, the spec is not prohibiting it.

Code-wise it is the same except I adopted a suggestion to move a repeated check 
to a shared method.

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

PR Comment: https://git.openjdk.org/jdk/pull/27640#issuecomment-6046385738

Reply via email to