Skip to content
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

8193442: Removing TreeItem from a TreeTableView sometime changes selectedItem #753

Closed

Conversation

jperedadnr
Copy link
Collaborator

@jperedadnr jperedadnr commented Mar 14, 2022

This PR fixes JDK-8193442, but also JDK-8187596, and verifies that the tests mentioned in JDK-8088157 are working (with a minor fix).

When removing an item that is below the selected item from TreeTableView or TreeView controls the selection and/or focus was wrongly changed in some occasions, because a shift in the selection was applied.

This PR adds a method to ControlUtils to get the index of the sibling that is selected/focused or contains the descendant item with the current selection/focus.

This index is required to compare properly if the selected/focus item is above or below the item that was removed, by comparing the indices of siblings.

Tests have been added to TreeViewTest and TreeTableViewTest based on the existing tests on JDK-8193442 and JDK-8187596. The four tests fail without this PR, pass with it.

In the process, I noticed that the ignored tests referred from JDK-8088157 were already passing, after removing some obsolete asserts, even without this PR.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issues

  • JDK-8193442: Removing TreeItem from a TreeTableView sometime changes selectedItem
  • JDK-8187596: TreeView selection incorrectly changes after deleting an unselected row

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jfx pull/753/head:pull/753
$ git checkout pull/753

Update a local copy of the PR:
$ git checkout pull/753
$ git pull https://git.openjdk.java.net/jfx pull/753/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 753

View PR using the GUI difftool:
$ git pr show -t 753

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jfx/pull/753.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 14, 2022

👋 Welcome back jpereda! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Ready for review label Mar 14, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 14, 2022

Webrevs

@kevinrushforth kevinrushforth requested a review from aghaisas Mar 15, 2022
@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 15, 2022

/reviewers 2

@kevinrushforth kevinrushforth self-requested a review Mar 15, 2022
@openjdk
Copy link

openjdk bot commented Mar 15, 2022

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

kevinrushforth commented Mar 15, 2022

The GHA test failure on macOS was due to JDK-8282449 and not anything in this PR. I filed a new bug to skip the failing tests until that bug can be fixed. See PR #754.

@jperedadnr
Copy link
Collaborator Author

jperedadnr commented Apr 4, 2022

@kevinrushforth Thanks for the test fix. Do I need to add a change in order to pass the tests again?

@kevinrushforth
Copy link
Member

kevinrushforth commented Apr 4, 2022

You would need to merge the latest master to pick up that fix, which will also trigger another GHA run.

@jperedadnr
Copy link
Collaborator Author

jperedadnr commented Apr 4, 2022

@kevinrushforth Thanks, that worked and the tests pass (as it was expected).

Copy link
Collaborator

@aghaisas aghaisas left a comment

Looks good to me.
Apart from the bug id in title, you can use /issue command to list additional issues this PR fixes.

@jperedadnr
Copy link
Collaborator Author

jperedadnr commented Apr 22, 2022

/issue JDK-8187596

@openjdk
Copy link

openjdk bot commented Apr 22, 2022

@jperedadnr
Adding additional issue to issue list: 8187596: TreeView selection incorrectly changes after deleting an unselected row.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Looks good.

In the process, I noticed that the ignored tests referred from JDK-8088157 were already passing, after removing some obsolete asserts, even without this PR.

After this is integrated, can you close JDK-8088157 as "Cannot reproduce"?

@openjdk
Copy link

openjdk bot commented Apr 22, 2022

@jperedadnr 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:

8193442: Removing TreeItem from a TreeTableView sometime changes selectedItem
8187596: TreeView selection incorrectly changes after deleting an unselected row

Reviewed-by: aghaisas, kcr

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 4 new commits pushed to the master branch:

  • 166d5c2: 8278430: Several tests use terminally deprecated System.runFinalization method
  • 5a023bd: 8285034: Skip ServiceTest.testManyServicesRunConcurrently on Windows
  • 7ddcb8b: 8282449: Intermittent OOM error in PredefinedMeshManagerTest
  • c4b1a72: 8283218: Update GStreamer to 1.20.1

Please see this link for an up-to-date comparison between the source branch of this pull request and the master branch.
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Apr 22, 2022
@jperedadnr
Copy link
Collaborator Author

jperedadnr commented Apr 22, 2022

/integrate

@openjdk
Copy link

openjdk bot commented Apr 22, 2022

Going to push as commit 3bb2db1.
Since your change was applied there have been 4 commits pushed to the master branch:

  • 166d5c2: 8278430: Several tests use terminally deprecated System.runFinalization method
  • 5a023bd: 8285034: Skip ServiceTest.testManyServicesRunConcurrently on Windows
  • 7ddcb8b: 8282449: Intermittent OOM error in PredefinedMeshManagerTest
  • c4b1a72: 8283218: Update GStreamer to 1.20.1

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Apr 22, 2022
@openjdk openjdk bot closed this Apr 22, 2022
@openjdk openjdk bot removed ready Ready to be integrated rfr Ready for review labels Apr 22, 2022
@openjdk
Copy link

openjdk bot commented Apr 22, 2022

@jperedadnr Pushed as commit 3bb2db1.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated
3 participants