RFR: JDK-8297413: Remove easy warnings in javafx.graphics [v4]

John Hendrikx jhendrikx at openjdk.org
Tue Dec 6 08:58:05 UTC 2022


On Tue, 22 Nov 2022 22:30:16 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> I agree.  The problem is that we will not be able to enable the warning in IDE, or it has to be @suppressed.
>> 
>> So the choice is either fix the code and enable warning, or keep the code as is and disable the warning.
>
> I don't see it as a useful warning. The code isn't necessarily better without, and can be less clear. I think this might argue for asking Eclipse users to disable this warning in the IDE.

@kevinrushforth Is this okay as it is?  Even though the benefit of removing the cast here is minimal, removing it still seems better as it won't need to be suppressed later if we decide to enforce the rules as part of the build.  In this specific case, there was no obvious way to "break" the code (by losing precision) by changing something unrelated (like changing `ptSize` to `double` or `long`).

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

PR: https://git.openjdk.org/jfx/pull/960


More information about the openjfx-dev mailing list