RFR: 4690476: NegativeArraySizeException from AffineTransformOp with shear
Francesco Andreuzzi
fandreuzzi at openjdk.org
Mon Oct 13 09:38:18 UTC 2025
On Thu, 9 Oct 2025 18:48:56 GMT, Phil Race <prr at openjdk.org> wrote:
>> src/java.desktop/share/classes/java/awt/image/AffineTransformOp.java line 455:
>>
>>> 453: return createCompatibleDestImage(src, destCM, r);
>>> 454: } catch (Exception e) {
>>> 455: if (e instanceof RasterFormatException) {
>>
>> How about two `catch` blocks? One catching `RasterFormatException` and a fallback to `Exception`.
>
> That would be another way to code it, but the outcome is the same and I suspect this is marginally more efficient. And an exception should be extremely rare.
My comment was more about code style than performance, but thanks for checking.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27707#discussion_r2425713976
More information about the client-libs-dev
mailing list