RFR: 8289394: Fix warnings: Unlikely argument type
Andy Goryachev
duke at openjdk.org
Mon Jul 18 19:30:22 UTC 2022
On Mon, 18 Jul 2022 14:33:16 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:
>> modules/javafx.base/src/test/java/test/javafx/collections/ObservableSubListTest.java line 161:
>>
>>> 159: @Test
>>> 160: public void testEqualsOnAnotherType() {
>>> 161: assertFalse(sublist.equals(Integer.valueOf(7)));
>>
>> I'm not sure I see the point of this test. It's testing the implementation of the backing list, not the behavior of the sublist. Same for some other methods in this test, though it's not related to this PR. Let's see what Kevin thinks here.
>
> It might be worth a separate bug to look at this.
This code is from 2013, what appears to be the initial open sourcing of javafx-beans.
I can see one may want to explicitly test a scenario when equals() is called with a different type (which should always return false), so this might be a fully legitimate test case.
The problem is that eclipse generates a warning - and in this case it should be suppressed. This warning is *very* helpful.
I suggest we keep the test and @SuppressWarnings("unlikely-arg-type").
-------------
PR: https://git.openjdk.org/jfx/pull/823
More information about the openjfx-dev
mailing list