RFR: 8187145: (Tree)TableView with null selectionModel: throws NPE on sorting [v5]
Jeanette Winzenburg
fastegal at openjdk.org
Fri Nov 4 14:19:39 UTC 2022
On Fri, 4 Nov 2022 05:07:17 GMT, Ajit Ghaisas <aghaisas at openjdk.org> wrote:
>> There is a `return null` on line 176.
>> In that case, we will return from either line 173 or line 176. Hence, there is no fall through.
>
> Any comments on this?
hmm .. maybe this is a mis-understanding:
- the case selected_items looks fishy (also in the original) - seems to not return if the selection is empty or now if the selection is null
- every known case should return under any condition, IMO, delegating to super is done only for unhandled cases
Also, selected_items looks weird to return from inside the loop across the selected cells on the very first iteration. Might be a bug.
BTW: did I ever mention that we need tests for everything we change ;) See the equivalent fix for ListView for how to ..
-------------
PR: https://git.openjdk.org/jfx/pull/876
More information about the openjfx-dev
mailing list