RFR: 4690476: NegativeArraySizeException from AffineTransformOp with shear [v2]

Phil Race prr at openjdk.org
Wed Dec 3 01:35:14 UTC 2025


> 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

Phil Race has updated the pull request incrementally with one additional commit since the last revision:

  4690476

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/27707/files
  - new: https://git.openjdk.org/jdk/pull/27707/files/65ae972a..94804448

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=27707&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=27707&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/27707.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/27707/head:pull/27707

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


More information about the client-libs-dev mailing list