-
Notifications
You must be signed in to change notification settings - Fork 473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8344067: TableCell indices may not match the TableRow index #1635
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back mhanl! A progress list of the required criteria for merging this PR into |
@Maran23 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 1 new commit pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
Webrevs
|
I'll review, thanks! |
The bug is present in TableView and TreeTableView, but not TreeView - is this correct? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested with SCCE found in the ticket on macOS M1 14.7, also some limited testing with the monkey tester, no issues found.
looks good; left some very minor formatting suggestions - will re-approve should you decide to fix.
thanks for writing the tests!
1 reviewer should be enough.
modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewRowTest.java
Outdated
Show resolved
Hide resolved
modules/javafx.controls/src/test/java/test/javafx/scene/control/TableViewTest.java
Show resolved
Hide resolved
Yes since EDIT: Could not reproduce with the |
This PR fixes a bug where the
TableCell
indices can be outdated (not synchronized) with theTableRow
index.What normally happens is:
TableCells
Under some circumstances, when a
TableRow
is reused (e.g. index 60 -> 1) the item can be the same->
oldIndex != newIndex && oldItem == newItem
This can happen when the items of a
TableView
are changed, but some items are the same in both item lists (Think about a filter, where we filter down 60 to 2 items).-> In this scenario, the cell update is not triggered, so the underlying
TableCell
indices will not be updated ever (e.g. they still have index 60 set, but the row has 1 now).The fix is to always update the underlying
TableCell
indices when theTableRow
index changed.While usually the item is different when the index changed, this is not always the case (there is no guarantee that the item changed, as we can see in the example, where the cell is reused).
Also made sure that the issues linked in the code and ticket do not regress:
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx.git pull/1635/head:pull/1635
$ git checkout pull/1635
Update a local copy of the PR:
$ git checkout pull/1635
$ git pull https://git.openjdk.org/jfx.git pull/1635/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 1635
View PR using the GUI difftool:
$ git pr show -t 1635
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/1635.diff
Using Webrev
Link to Webrev Comment