[OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

Phil Race prr at openjdk.java.net
Wed Apr 7 20:17:36 UTC 2021


On Fri, 2 Apr 2021 23:06:43 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> - The hand-crafted methods for addition and multiplication are replaced by the "Math" versions.
>> - Cleanup: the usage of do/while(false) is removed
>
> The nice PR number: 3333!

I don't understand the exception handling here. multiplyExact and addExact will throw a runtime exception - ArithmeticException. And I don't see where it is caught. The change for ImageLayoutException to extend ArithmeticException doesn't seem like it can help here. Where is the ArithmeticException being turned into ImageLayoutException ?

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

PR: https://git.openjdk.java.net/jdk/pull/3333


More information about the 2d-dev mailing list