On Thu, 9 Jul 2026 17:09:48 GMT, Andy Goryachev <[email protected]> wrote:
>> John Hendrikx has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Fix flakey check on (asynchronous) stderr output
>
> modules/javafx.base/src/main/java/com/sun/javafx/binding/ListenerManager.java
> line 73:
>
>> 71: }
>> 72:
>> 73: private void addListenerInternal(I instance, Object listener) {
>
> what will happen when I add a listener object that implements both
> `InvalidationListener` and `ChangeListener`?
>
> what will happen when I remove it?
After my update, it will depend on which `add` or `removeListener` call you use
(you will need to cast your call to pick the correct one -- this is probably
also the reason you won't see such things in the wild very often, as you'll
need to cast when adding such a dual listener as well).
So if you cast it to change listener, and it wasn't added before, nothing
happens, even if is present as an invalidation listener. If it was present,
only the change listener is removed, and the invalidation listener remains
there.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1081#discussion_r3562146307