RFR: 8279640: ListView with null SelectionModel/FocusModel throws NPE
Jeanette Winzenburg
fastegal at openjdk.org
Mon Aug 22 17:30:07 UTC 2022
On Mon, 22 Aug 2022 15:43:28 GMT, Jeanette Winzenburg <fastegal at openjdk.org> wrote:
>> There is also an unguarded access in CellBehaviorBase.selectRows(int,int) : 312 and CellBehaviorBase.sompleSelect(MouseButton,int,boolean) : 274, which are being fixed by #876
>>
>> I'd suggest to integrate #876 first, followed by this PR, in order to avoid merge conflicts.
>
>> There is also an unguarded access in CellBehaviorBase.selectRows(int,int) : 312 and CellBehaviorBase.sompleSelect(MouseButton,int,boolean) : 274, which are being fixed by #876
>>
>> I'd suggest to integrate #876 first, followed by this PR, in order to avoid merge conflicts.
>
> @andy-goryachev-oracle hmm .. are those methods reached if selectionModel == null? On skimming across its code, it looks like all callers back out (that is not call it) without selectionModel. Might be wrong, though - hard to tell without documented preconditions, and without tests 😉
> @kleopatra : simpleSelect and selectRows are being called from CellBehaviorBase.mousePressed and mouseReleased, so probably yes. in any way, they are updated in #876 ; fixing them here would likely create a merge conflict.
@andy-goryachev-oracle, to be precise: the mouse methods call doSelect which backs out if focus- or selectionModel is null - so doesn't look like we should touch simpleSelect/selectRows. Except maybe by adding a precondition that the selection/focusModel must not be null. But we'll see in review, you might convince me with tests :)
Here at least cell behavior is not changed, so changes in the other PR wouldn't cause a conflict.
-------------
PR: https://git.openjdk.org/jfx/pull/711
More information about the openjfx-dev
mailing list