On Sun, 3 May 2026 20:21:11 GMT, Marius Hanl <[email protected]> wrote:

> Fixes that the `TabObservableList` creates wrong `permutation` change events. 
> As they are wrong, listeners that rely on the change events like 
> `FilteredList` will get confused and do the wrong things.
> 
> I was wondering why the `TabPaneSkin` was not affected, as it installs a 
> listener on the tabs.
> Turns out this is because the code path is not triggered when the tabs are 
> reordered by dragging as can be seen here:
> 
> https://github.com/openjdk/jfx/blob/697a534bf494d82bf8e0ecacfebaba003dcc6c7a/modules/javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java#L606-L609
> 
> So this issue is rather rare and limited to listeners installed by the 
> developer (and interested in permutation events).
> Or using a `FilteredList` with the tabs, which will install such a listener 
> as well.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

I feel the code might have been simpler, but it does fix the issue, which is ok 
with me.  The new test fails in master and passes with the fix.  Also tested 
with the updated monkey tester 
https://github.com/andy-goryachev-oracle/MonkeyTest

(stdout shows the original tab list + filtered one)

@Ziad-Mid could you be the second reviewer please?

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

Marked as reviewed by angorya (Reviewer).

PR Review: https://git.openjdk.org/jfx/pull/2164#pullrequestreview-4291907876
PR Comment: https://git.openjdk.org/jfx/pull/2164#issuecomment-4452950317

Reply via email to