Fixed bad comparator; updated the table update job to not fail for

sorting exceptions
This commit is contained in:
dragonmacher
2022-12-02 11:13:56 -05:00
parent d182ba8edb
commit d39f79ed24
@@ -68,8 +68,8 @@ public class TableUpdateJob<T> {
private TableData<T> sourceData; private TableData<T> sourceData;
private TableData<T> updatedData; private TableData<T> updatedData;
private boolean disableSubFiltering = SystemUtilities.getBooleanProperty( private boolean disableSubFiltering = SystemUtilities
RowObjectFilterModel.SUB_FILTERING_DISABLED_PROPERTY, false); .getBooleanProperty(RowObjectFilterModel.SUB_FILTERING_DISABLED_PROPERTY, false);
private volatile boolean reloadData; private volatile boolean reloadData;
private volatile boolean doForceSort; private volatile boolean doForceSort;
@@ -528,6 +528,13 @@ public class TableUpdateJob<T> {
catch (SortCancelledException e) { catch (SortCancelledException e) {
// do nothing, the old data will remain // do nothing, the old data will remain
} }
catch (Exception e) {
// We added this to catch an issue if the sort comparators violate the contract of
// Comparator. TimSort will throw an exception in this case. We have decided to not
// throw the exception. This will allow the currently loaded data to be used, albeit
// unsorted.
Msg.error(this, "Unable to finish table sorting", e);
}
monitor.setMessage("Done sorting"); monitor.setMessage("Done sorting");
} }