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

Jeanette Winzenburg fastegal at openjdk.org
Fri Aug 19 09:06:41 UTC 2022


On Thu, 18 Aug 2022 16:24:11 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

> 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](https://bugs.openjdk.org/browse/JDK-8279640).
> 
> changes:
> - added check for null selection model where it was missing
> - clearing focused row index on setting null selection model in TreeTableView

hmm ... where are the tests ;) The similar [PR 711](https://github.com/openjdk/jfx/pull/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)

-------------

PR: https://git.openjdk.org/jfx/pull/876


More information about the openjfx-dev mailing list