RFR: 8289394: Fix warnings: Unlikely argument type
Andy Goryachev
duke at openjdk.org
Mon Jul 18 17:05:07 UTC 2022
On Mon, 18 Jul 2022 14:34:42 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> Fixes "Unlikely argument type" warning generated by the latest Eclipse IDE.
>>
>> This warning should be reclassified as an error, as it catches bugs missed by javac. In this case, the following places seem to contain bugs:
>> - apps/samples/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer/TimelineController.java
>> - modules/javafx.graphics/src/main/java/com/sun/glass/ui/monocle/GetEvent.java
>>
>> The fixes include:
>> - using objects of the right type
>> - adding @SuppressWarnings("unlikely-arg-type") in places where intended (e.g. assertFalse)
>>
>> There was an earlier discussion about using IDE-specific @SuppressWarnings in the code. While I might disagree (I think it is ok to use IDE-specific @SuppressWarnings), the tests can be reworked to avoid @SuppressWarnings. Please let me know. Thanks!
>
> modules/javafx.graphics/src/test/java/test/javafx/css/Node_cssStyleMap_Test.java line 80:
>
>> 78: * @param map
>> 79: * @param decls
>> 80: */
>
> This is unrelated to the fix, so it seems best to revert this.
I insist. Whenever method signature cannot ensure type safety, the next guard, or at least some human-readable safety check should be a (javadoc) comment, wouldn't you agree?
-------------
PR: https://git.openjdk.org/jfx/pull/823
More information about the openjfx-dev
mailing list