RFR: JDK-8298528: Clean up raw type warnings in base in bindings and collections packages [v2]
John Hendrikx
jhendrikx at openjdk.org
Sun Jan 1 16:08:15 UTC 2023
On Fri, 30 Dec 2022 16:21:10 GMT, Nir Lisker <nlisker at openjdk.org> wrote:
>> I'm fine with that; the first two are equivalent, but in some cases I need to add the type witness to avoid a warning and you can only do that by adding the class name as well (ie. `<E>emptyList()` is not allowed, but `ListExpression.<E>emptyList()` is.
>
> Why not use `FXCollections.<E>emptyObservableList()` directly? If it's too long, a convenvenience method can be used:
>
> private static <E> ObservableList<E> emptyList() {
> return FXCollections.<E>emptyObservableList();
> }
>
> No need to hold the instance here again in a way that makes it lose its type and do the same cast (and supress the warning) that `FXCollections` already does.
>
> Same with the other collections.
I've removed the repeated checks from these classes.
-------------
PR: https://git.openjdk.org/jfx/pull/972
More information about the openjfx-dev
mailing list