jfx icon indicating copy to clipboard operation
jfx copied to clipboard

8187145: (Tree)TableView with null selectionModel: throws NPE on sorting

Open andy-goryachev-oracle opened this issue 2 years ago • 1 comments

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 not done in several parts of the code. 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
  • clearing focused row index on setting null selection model in TreeTableView

Progress

  • [ ] Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • [x] Change must not contain extraneous whitespace
  • [x] Commit message must refer to an issue

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/864/head:pull/864
$ git checkout pull/864

Update a local copy of the PR:
$ git checkout pull/864
$ git pull https://git.openjdk.org/jfx pull/864/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 864

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jfx/pull/864.diff

andy-goryachev-oracle avatar Aug 05 '22 21:08 andy-goryachev-oracle

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

bridgekeeper[bot] avatar Aug 05 '22 21:08 bridgekeeper[bot]

cannot edit source branch in a PR, will open another one.

andy-goryachev-oracle avatar Aug 18 '22 16:08 andy-goryachev-oracle