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

John Hendrikx jhendrikx at openjdk.org
Sun Jan 1 15:14:57 UTC 2023


On Wed, 28 Dec 2022 19:11:38 GMT, Nir Lisker <nlisker at openjdk.org> wrote:

>> Packages fixed:
>> - com.sun.javafx.binding
>> - com.sun.javafx.collections
>> - javafx.beans
>> - javafx.beans.binding
>> - javafx.collections
>> - javafx.collections.transformation
>
> modules/javafx.base/src/main/java/com/sun/javafx/binding/ContentBinding.java line 89:
> 
>> 87:             ListContentBinding<Object> binding = new ListContentBinding<>((List<Object>) list1);
>> 88: 
>> 89:             list2.removeListener(binding);
> 
> Another problem inherited from the existing code. What if the `obj2` is a `List` and `obj1` is an `ObservableList`? The docs don't say anything about the order.
> 
> Same question as before about adding a comment addressing the case that the two lists are not of the same type.

Yes, looks like this is quite broken. This wouldn't have gone unnoticed so long if unbind would just throw an exception when nothing could be unbound; silently failing is never a good idea.

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

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


More information about the openjfx-dev mailing list