RFR: JDK-8298528: Clean up raw type warnings in base in bindings and collections packages [v4]

Nir Lisker nlisker at openjdk.org
Sun Feb 12 18:38:43 UTC 2023


On Sun, 1 Jan 2023 15:25:01 GMT, John Hendrikx <jhendrikx at openjdk.org> wrote:

>> modules/javafx.base/src/main/java/javafx/collections/FXCollections.java line 1640:
>> 
>>> 1638:         @Override
>>> 1639:         public Iterator<E> iterator() {
>>> 1640:             return new Iterator<>() {
>> 
>> Here the empty `Set` creates a listener on invocation, unlike in the list case. Might want to keep a single pattern. I prefer the one with a singleton iterator because the empty set itself is a singleton. Same comment about considering "inlining" it.
>
> Can make these consistent if the approach is agreed upon.

So let's make the list and the set use an instance singleton pattern, like the empty list does.

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

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


More information about the openjfx-dev mailing list