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).

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

Commit messages:
 - 8359020: TabObservableList.reorder changes content of filtered list

Changes: https://git.openjdk.org/jfx/pull/2164/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2164&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8359020
  Stats: 56 lines in 2 files changed: 51 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jfx/pull/2164.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2164/head:pull/2164

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

Reply via email to