On Fri, 10 Jul 2026 13:43:37 GMT, John Hendrikx <[email protected]> wrote:
>> modules/javafx.base/src/main/java/com/sun/javafx/binding/ListenerListBase.java
>> line 350:
>>
>>> 348: Object listener = CHANGE_LISTENERS.get(this, i);
>>> 349:
>>> 350: if (listener instanceof InvalidationListener il) {
>>
>> a listener might implement both `InvalidationListener` and `ChangeListener`,
>> the logic here will break.
>
> Indeed, a very nice catch. I'll resolve this by detecting this and wrapping
> such listeners. Wrapping is I think justified as such dual purpose listeners
> are extremely rare in practice, and it keeps the downstream logic the same;
> it also means the optimization for single listeners can remain in place (ie.
> if there is only one listener, we can store that directly in the
> `listenerData` field still as its type will always be unambiguous).
It's resolved now, I added a test that checks this.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r3560061698