On Sun, 5 Oct 2025 20:33:26 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 > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai).
This pull request has now been integrated. Changeset: ce986f72 Author: Phil Race <[email protected]> URL: https://git.openjdk.org/jdk/commit/ce986f721b1d1e4d1503c50b8070a52f6f4e970a Stats: 216 lines in 2 files changed: 207 ins; 8 del; 1 mod 4617681: Constructor of BufferedImage throws unexpected IllegalArgumentException Reviewed-by: jdv, psadhukhan, dnguyen ------------- PR: https://git.openjdk.org/jdk/pull/27640
