JDK-8289394 : Fix warnings: Unlikely argument type
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: openjfx19
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2022-06-28
  • Updated: 2022-11-29
  • Resolved: 2022-07-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
openjfx20 b01Fixed
Related Reports
Blocks :  
Description
Eclipse Version 2022-06 (4.24.0) reports this warning in the following places:

```
Unlikely argument type CssMetaData for containsKey(Object) on a Map<String,List<CascadingStyle>>	Node_cssStyleMap_Test.java	line 291	/graphics/src/test/java/test/javafx/css
Unlikely argument type CssMetaData for containsKey(Object) on a Map<String,List<CascadingStyle>>	Node_cssStyleMap_Test.java	line 295	/graphics/src/test/java/test/javafx/css
Unlikely argument type for equals(): Color seems to be unrelated to LinearGradient	LinearGradientTest.java	line 115	/graphics/src/test/java/test/javafx/scene/paint
Unlikely argument type for equals(): Color seems to be unrelated to LinearGradient	LinearGradientTest.java	line 116	/graphics/src/test/java/test/javafx/scene/paint
Unlikely argument type for equals(): Color seems to be unrelated to RadialGradient	RadialGradientTest.java	line 118	/graphics/src/test/java/test/javafx/scene/paint
Unlikely argument type for equals(): Color seems to be unrelated to RadialGradient	RadialGradientTest.java	line 119	/graphics/src/test/java/test/javafx/scene/paint
Unlikely argument type for equals(): Integer seems to be unrelated to List<String>	ObservableSubListTest.java	line 159	/base/src/test/java/test/javafx/collections
Unlikely argument type for equals(): int seems to be unrelated to Duration	TimelineController.java	line 79	/samples/3DViewer/src/main/java/com/javafx/experiments/jfx3dviewer
Unlikely argument type for equals(): Property<T> seems to be unrelated to BidirectionalBinding	BidirectionalBindingTest.java	line 217	/base/src/test/java/test/com/sun/javafx/binding
Unlikely argument type for equals(): String seems to be unrelated to Background	BackgroundTest.java	line 346	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BackgroundFill	BackgroundFillTest.java	line 86	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BackgroundImage	BackgroundImageTest.java	line 218	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BackgroundPosition	BackgroundPositionTest.java	line 153	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BackgroundSize	BackgroundSizeTest.java	line 246	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to Border	BorderTest.java	line 562	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BorderStrokeStyle	BorderStrokeStyleTest.java	line 175	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type for equals(): String seems to be unrelated to BorderWidths	BorderWidthsTest.java	line 206	/graphics/src/test/java/test/javafx/scene/layout
Unlikely argument type Integer for contains(Object) on a Collection<String>	ObservableSubListTest.java	line 141	/base/src/test/java/test/javafx/collections
Unlikely argument type Property<capture#1-of ?> for get(Object) on a Map<StyleableProperty<?>,List<Style>>	Node_cssStyleMap_Test.java	line 78	/graphics/src/test/java/test/javafx/css
Unlikely argument type String for remove(Object) on a Collection<File>	GetEvent.java	line 104	/graphics/src/main/java/com/sun/glass/ui/monocle
```

Comments
Changeset: cb7460df Author: Andy Goryachev <andy.goryachev@oracle.com> Committer: Kevin Rushforth <kcr@openjdk.org> Date: 2022-07-19 15:27:14 +0000 URL: https://git.openjdk.org/jfx/commit/cb7460dfd5e537c457451991e4459eb1044e0956
19-07-2022

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!
08-07-2022

A pull request was submitted for review. URL: https://git.openjdk.org/jfx/pull/823 Date: 2022-07-08 20:31:31 +0000
08-07-2022