Alexander filed a bug : RT-28090.
He applied a sort operation over collection of data:
FXCollections.sort(chart.getData(), new Comparator<Data>() {
@Override
public int compare(Data o1, Data o2) {
return Double.compare(o1.getPieValue(), o2.getPieValue());
}
});
and found a bug (exception):
java.lang.IllegalArgumentException: Children: duplicate children added: parent = Chart$1@6a97e765[styleClass=chart-content]
Originally, issue appeared, when data was in a tableView, and a sort of column was applied, so that lead to sort of data, which is tracked by chart.
Looks like, this case should be tested for all controls, which have a collection of data, as a served data. Among them: ListView, TreeView (TreeItem), TableView, TreeTableView, ChoiceBox, ComboBox, all Charts, Accordion, Menu, MenuBar, TabPane, ToolBar.
I expect, that if control has a collection, then sort of that collection should be tested, and it could be done via junit tests. So, I expect junit tests, where it is applicable.
He applied a sort operation over collection of data:
FXCollections.sort(chart.getData(), new Comparator<Data>() {
@Override
public int compare(Data o1, Data o2) {
return Double.compare(o1.getPieValue(), o2.getPieValue());
}
});
and found a bug (exception):
java.lang.IllegalArgumentException: Children: duplicate children added: parent = Chart$1@6a97e765[styleClass=chart-content]
Originally, issue appeared, when data was in a tableView, and a sort of column was applied, so that lead to sort of data, which is tracked by chart.
Looks like, this case should be tested for all controls, which have a collection of data, as a served data. Among them: ListView, TreeView (TreeItem), TableView, TreeTableView, ChoiceBox, ComboBox, all Charts, Accordion, Menu, MenuBar, TabPane, ToolBar.
I expect, that if control has a collection, then sort of that collection should be tested, and it could be done via junit tests. So, I expect junit tests, where it is applicable.
- relates to
-
JDK-8124777 PieChart throws IAE when its elements are sorted
- Closed