RFR: JDK-8297413: Remove easy warnings in javafx.graphics
Kevin Rushforth
kcr at openjdk.org
Tue Nov 22 22:37:02 UTC 2022
On Tue, 22 Nov 2022 22:23:52 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> I would just revert it back.
>
> (long) width * height * 4;
> is dangerous if one does not remember the precedence rules - is typecast applied to width or the end result?
> 4L * w * h; is unambiguous.
I'm not sure I like either of the two choices you listed. By "revert it back" I mean leave the code alone. The existing code, with its explicit casts, leaves no room for doubt:
return ((long) width) * ((long) height) * 4L;
-------------
PR: https://git.openjdk.org/jfx/pull/960
More information about the openjfx-dev
mailing list