RFR: 4690476: NegativeArraySizeException from AffineTransformOp with shear
Phil Race
prr at openjdk.org
Wed Dec 3 01:36:52 UTC 2025
On Wed, 3 Dec 2025 00:54:52 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> > Take the evidence of the bug report where the exception is clearly unexpected and difficult to predict and could have bad consequences.
>
> In the bug description, it’s unclear whether the phrase “exception unexpected” means that an exception is unexpected, or that the type of the exception is “unexpected”. For example, if the transform is set to scale the image by a value near MAX_INT(AffineTransform.getScaleInstance(Integer.MAX_VALUE, 1)), is it really good thing to return an image of the original size with "corrupted" content? In what cases it might be useful?
There isn't corrupted content, it is partial content in the case of an image that is too large.
And this seems far more useful and friendly than the exception.
What you are raising is no more than what I called out in the description at the very beginning of this PR some 2 months ago.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/27707#issuecomment-3604654072
More information about the client-libs-dev
mailing list