On Tue, 7 Apr 2026 16:49:55 GMT, Charlie Schlosser <[email protected]> wrote:
>> modules/javafx.controls/src/main/java/javafx/scene/control/TableView.java
>> line 1734:
>>
>>> 1732: setComparator(oldComparator);
>>> 1733: sortLock = false;
>>> 1734: } else if (prevState != null) {
>>
>> I wonder if it would make sense to add tests that exercise transition of the
>> selection model from non-null to null and back, while tree/table is sorted.
>>
>> What do you guys think?
>
> Do your changes here address that concern?
>
> https://github.com/openjdk/jfx/pull/876/changes#diff-7b076b4153cd990da07d19831701b794278e0c875584e32505bb89c6dd2208d4
hmm, partially:
- all three `TreeItem`s have the same "" value, so sorting is probably a no-op
- I don't know whether (prevState == null) case is being tested: I see the
sorting is done with a null model, but there is no sorting done after setting a
non-null selection model.
Having said that, I think the fact that you already have a sorting test case
with a null selection model is probably good enough.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/2131#discussion_r3046630831