Integrated: 8279640: ListView with null SelectionModel/FocusModel throws NPE

Marius Hanl mhanl at openjdk.org
Wed Sep 14 13:18:00 UTC 2022


On Sat, 8 Jan 2022 00:17:36 GMT, Marius Hanl <mhanl at openjdk.org> wrote:

> This PR fixes a bunch of NPEs when a null `SelectionModel` or `FocusModel` is set on a `ListView`.
> 
> The following NPEs are fixed (all are also covered by exactly one test case):
> NPEs with null selection model:
> - Mouse click on a `ListCell`
> - SPACE key press
> - KP_UP (arrow up) key press
> - HOME key press
> - END key press
> - BACK_SLASH + CTRL key press
> 
> NPEs with null focus model:
> - SPACE key press
> - Select an items: getSelectionModel().select(1)
> - Clear-Select an item and add one after: `listView.getSelectionModel().clearAndSelect(1); listView.getItems().add("3");`

This pull request has now been integrated.

Changeset: 27f19050
Author:    Marius Hanl <mhanl at openjdk.org>
URL:       https://git.openjdk.org/jfx/commit/27f1905077cbc475fbce1b0f8d950d014dbb07a4
Stats:     236 lines in 5 files changed: 205 ins; 18 del; 13 mod

8279640: ListView with null SelectionModel/FocusModel throws NPE

Reviewed-by: fastegal, aghaisas

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

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


More information about the openjfx-dev mailing list