jfx
jfx copied to clipboard
8187145: (Tree)TableView with null selectionModel: throws NPE on sorting
Setting a null selection model in TableView and TreeTableView produce NPE on sorting (and probably in some other situations) because the check for null is missing in several places.
Setting a null selection model is a valid way to disable selection in a (tree)table.
There is also a similar issue with ListView JDK-8279640.
changes:
- added check for null selection model where it was missing
- clear focused row index on setting null selection model in TreeTableView
- clear selected cells on setting a new selection model
Progress
- [x] Change must not contain extraneous whitespace
- [x] Commit message must refer to an issue
- [ ] Change must be properly reviewed (2 reviews required, with at least 1 Reviewer, 1 Author)
Issue
- JDK-8187145: (Tree)TableView with null selectionModel: throws NPE on sorting
Reviewing
Using git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jfx pull/876/head:pull/876
$ git checkout pull/876
Update a local copy of the PR:
$ git checkout pull/876
$ git pull https://git.openjdk.org/jfx pull/876/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 876
View PR using the GUI difftool:
$ git pr show -t 876
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/876.diff
:wave: Welcome back angorya! 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.
Webrevs
- 14: Full - Incremental (303f1dd4)
- 13: Full (5093f056)
- 12: Full (2e19c490)
- 11: Full (03409ea5)
- 10: Full - Incremental (8065548c)
- 09: Full - Incremental (5e3b0076)
- 08: Full - Incremental (f2feee5b)
- 07: Full (df3aed13)
- 06: Full - Incremental (45b2e03a)
- 05: Full (efe84b7a)
- 04: Full (fed5dfdb)
- 03: Full - Incremental (bf8a0b37)
- 02: Full - Incremental (5f37fe6d)
- 01: Full - Incremental (d6d185fc)
- 00: Full (df5a2402)
hmm ... where are the tests ;) The similar PR 711 has examples that probably can be adapted for testing Tree/TableView as well (would expect that there might be more due to column navigation)
hmm ... where are the tests ;)
good point. will do.
@andy-goryachev-oracle this pull request can not be integrated into master due to one or more merge conflicts. To resolve these merge conflicts and update this pull request you can run the following commands in the local repository for your personal fork:
git checkout 8187145.null.selection.model
git fetch https://git.openjdk.org/jfx master
git merge FETCH_HEAD
# resolve conflicts and follow the instructions given by git merge
git commit -m "Merge master"
git push
/reviewers 2
@kevinrushforth The total number of required reviews for this PR (including the jcheck configuration and the last /reviewers command) is now set to 2 (with at least 1 Reviewer, 1 Author).
26 minutes since the last push, github does not see the changes. what gives?
@Maran23 would you review this please?
@andy-goryachev-oracle 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:
8187145: (Tree)TableView with null selectionModel: throws NPE on sorting
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 6 new commits pushed to the master branch:
- adfc022060087490d0a620f38104a826411820ae: 8290040: Provide simplified deterministic way to manage listeners
- f217d5e9564e87eb573b7990fa9bfb395f75c070: 8298200: Clean up raw type warnings in javafx.beans.property.* and com.sun.javafx.property.*
- 8763e8b0d67db33fc3aa40c459058957e3230346: 8190411: NPE in SliderSkin:140 if Slider.Tooltip.autohide is true
- dadfcaf43f4bc682aa7a73cbe6f2ede88f89a639: 8295339: DatePicker updates its value property with wrong date when dialog closes
- 9f6ec88b222461da9486911ecefb68a936e5fc77: 8295755: Update SQLite to 3.39.4
- c900a00c7527f290e8047792fef4b45002930892: 8289357: (Tree)TableView is null in (Tree)TableRowSkin during autosize
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.
formatting fixed. please re-approve. @kevinrushforth @aghaisas
/integrate
Going to push as commit 58376eb844866f7e2fea726865eb2f821b09752f.
Since your change was applied there have been 6 commits pushed to the master branch:
- adfc022060087490d0a620f38104a826411820ae: 8290040: Provide simplified deterministic way to manage listeners
- f217d5e9564e87eb573b7990fa9bfb395f75c070: 8298200: Clean up raw type warnings in javafx.beans.property.* and com.sun.javafx.property.*
- 8763e8b0d67db33fc3aa40c459058957e3230346: 8190411: NPE in SliderSkin:140 if Slider.Tooltip.autohide is true
- dadfcaf43f4bc682aa7a73cbe6f2ede88f89a639: 8295339: DatePicker updates its value property with wrong date when dialog closes
- 9f6ec88b222461da9486911ecefb68a936e5fc77: 8295755: Update SQLite to 3.39.4
- c900a00c7527f290e8047792fef4b45002930892: 8289357: (Tree)TableView is null in (Tree)TableRowSkin during autosize
Your commit was automatically rebased without conflicts.
@andy-goryachev-oracle Pushed as commit 58376eb844866f7e2fea726865eb2f821b09752f.
:bulb: You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.