RFR: 8279640: ListView with null SelectionModel/FocusModel throws NPE [v2]
Marius Hanl
mhanl at openjdk.org
Sun Sep 11 19:27:51 UTC 2022
> 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");
Marius Hanl has updated the pull request incrementally with three additional commits since the last revision:
- Fix NPE for null selection/focus -model in queryAccessibleAttribute(..)
- Still set anchor when the selection model is null
- Using global StageLoader
-------------
Changes:
- all: https://git.openjdk.org/jfx/pull/711/files
- new: https://git.openjdk.org/jfx/pull/711/files/d31d3ecc..ffe781dd
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jfx&pr=711&range=01
- incr: https://webrevs.openjdk.org/?repo=jfx&pr=711&range=00-01
Stats: 89 lines in 4 files changed: 71 ins; 11 del; 7 mod
Patch: https://git.openjdk.org/jfx/pull/711.diff
Fetch: git fetch https://git.openjdk.org/jfx pull/711/head:pull/711
PR: https://git.openjdk.org/jfx/pull/711
More information about the openjfx-dev
mailing list