8237602: TabPane doesn't respect order of TabPane.getTabs() list #201
Conversation
|
Webrevs
|
didn't look closely, just wondering why you need a system test for this? |
The following is wrong in your Description:
Based on what I see in the bug report (and what I would expect), I'm pretty sure you meant to say: The tab headers should be shown in order as tab0, tab1, tab2, tab3. |
/reviewers 2 |
@kevinrushforth |
The system test file |
Thanks Kevin, the description is corrected now. |
yeah, if we don't document everything :))) Would you consider moving both into a unit test? Have one locally, could send it to you .. Also a minor quirk as to the naming: it should not name it "permutation" because it isn't from the perspective of the list change: the notification is a "replace". Btw, the pattern in the listener (of collecting up additions/removals) is a bit smelly - will fail as soon as you get disjoint additions (on the bright side: they don't happen in the current implementation of ObservableList but are allowed to), just something to keep in mind :) |
A ready test
I did try to change whole implementation, but it looked like a big change for the issue we have. The fix is very minimal and local.
Shall think of a new name when we move the tests.. |
not quite complete, just nearly - attached the unit test to the issue JDK-8244195 you created
good with me, as long as it covers all possible modifications to the tabs list have a nice weekend (holiday here in Berlin tomorrow, so I might be off, except that with corona there's not so much too do, except working :) |
I think the change is fine, although I still need to run it. I have a couple questions / comments. |
...javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java
Show resolved
Hide resolved
...javafx.controls/src/main/java/javafx/scene/control/skin/TabPaneSkin.java
Show resolved
Hide resolved
...tem/src/test/java/test/robot/javafx/scene/TabPanePermuteGetTabsTest.java
Outdated
Show resolved
Hide resolved
...tem/src/test/java/test/robot/javafx/scene/TabPanePermuteGetTabsTest.java
Show resolved
Hide resolved
tests are passing, what else can we achieve with a fix :) Looks good! |
@arapte This change now passes all automated pre-integration checks. When the change also fulfills all project specific requirements, type
Since the source branch of this PR was last updated there have been 23 commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid automatic rebasing, please merge
|
/integrate |
@arapte The following commits have been pushed to master since your change was applied:
Your commit was automatically rebased without conflicts. Pushed as commit 6e03930. |
Issue:
When tabs are permuted as mentioned in the issue description as,
the tab headers do not get permuted in same order as
TabPane.getTabs()
.=> tab headers should be shown in order as tab0, tab1, tab2, tab3.
=> but are show in order as tab2, tab3, tab0, tab1
Cause:
Newly added tabs(tab2, tab3) are not inserted at correct index. The index
Change.getFrom()
(0) used from Change does not remain valid after the tabs to be moved(tab0, tab1) are removed fromtabsToAdd
list.Fix:
Use the index of first newly added tab, from
TabPane.getTabs()
, which would be always reliable.Verification:
No existing tests fail due to this change.
Added a system test which fails without and pass with fix.
Progress
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jfx pull/201/head:pull/201
$ git checkout pull/201