-
Bug
-
Resolution: Withdrawn
-
P4
-
fx2.0
@Test
public void testDefaultComparator() {
TableColumn<String> column = new TableColumn<String>("some");
assertNotNull(column.getComparator());
column.setComparator(null);
assertNotNull(column.getComparator());
}
Implementation intention seem to be to use TableColumn.DEFAULT_COMPARATOR if none provided by client code. That's working until the first write access to the comparatorProperty: after that, any value is passed on to the property.
To fix, either implement a custom property which falls back to a default (might be a nice little general property, maybe already hidden somewhere in the code base?) or implement setComparator with a guard:
public void setComparator(Comparator c) {
comparatorProperty().set(c != null ? c : DEFAULT)
}