RFR: 8279640: ListView with null SelectionModel/FocusModel throws NPE
Andy Goryachev
angorya at openjdk.org
Mon Aug 22 16:42: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");
<img width="502" alt="Screen Shot 2022-08-22 at 09 37 36" src="https://user-images.githubusercontent.com/107069028/185973734-0e621e44-1427-4d95-a0a4-1664e9bf2aee.png">
-------------
PR: https://git.openjdk.org/jfx/pull/711
More information about the openjfx-dev
mailing list