RFR: 8284676: TreeTableView loses sort ordering when applied on empty table

Jose Pereda jpereda at openjdk.org
Tue Jul 12 23:35:51 UTC 2022


On Tue, 12 Jul 2022 15:59:17 GMT, Ambarish Rapte <arapte at openjdk.org> wrote:

> Issue: In a TreeTableView if root item has no children then TreeTableView does not retain if a sort order is set.
> 
> Cause: This is a regression of fix for [JDK-8256283](https://bugs.openjdk.org/browse/JDK-8256283), which returned false from `SortPolicy.call()` function if root item has no children. This function is called from `TreeTableView.sort()` line #1863. When the returned value is false then line #1885 gets executed, which removes the sort order that was added.
> 
> Fix: The fix for [JDK-8256283](https://bugs.openjdk.org/browse/JDK-8256283) is modified to return true instead. Added a test that fails without and passes with fix.

Looks good, minor naming issue

modules/javafx.controls/src/test/java/test/javafx/scene/control/TreeTableViewTest.java line 789:

> 787:     }
> 788: 
> 789:     @Test public void testSetSortOrderretainsWhenRootHasNoChildren() {

Minor, fix the camel case: `testSetSortOrderRetainsWhenRootHasNoChildren`

-------------

PR: https://git.openjdk.org/jfx/pull/825


More information about the openjfx-dev mailing list