Integrated: 4690476: NegativeArraySizeException from AffineTransformOp with shear

Phil Race prr at openjdk.org
Wed Dec 3 18:23:54 UTC 2025


On Wed, 8 Oct 2025 22:05:05 GMT, Phil Race <prr at openjdk.org> wrote:

> This fix does a couple of things
> 
> 1) AffineTransformOp.createCompatibleDestImage() and AffineTransformOp.createCompatibleDestRaster() now specify that they will throw RasterFormatException if the transformed size is too large. They were already getting an exception.
> Note that inside the JDK only the imaging API implementation itself uses these APIs and I suspect they are rarely used by applications.
> 
> 2) AffineTransformOp.filter(src, null) will not throw an exception if it cannot create a destination image or raster of the required size and instead will use the source image size. This means applications which simply filter() will not need to carefully examine the transform. Sophisticated applications which want to do this can use the above "create*" methods to explicitly create the destination to find this out. 
> 
> So some inconsistency but I think it is a user-friendly trade-off.
> 
> A CSR will be needed but I want to get past initial review first.
> Update : CSR is now created https://bugs.openjdk.org/browse/JDK-8370162

This pull request has now been integrated.

Changeset: aff25f13
Author:    Phil Race <prr at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/aff25f135af20ec89c7a68f2a0a0ede7eb1491a6
Stats:     141 lines in 2 files changed: 131 ins; 1 del; 9 mod

4690476: NegativeArraySizeException from AffineTransformOp with shear

Reviewed-by: psadhukhan, jdv

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

PR: https://git.openjdk.org/jdk/pull/27707


More information about the client-libs-dev mailing list