eclipse-nattable / nattable

High performance SWT data grid
https://eclipse.dev/nattable/
Eclipse Public License 2.0
15 stars 6 forks source link

[Filter] Filter combo cache not updating after closing other instance #77

Closed fipro78 closed 5 months ago

fipro78 commented 5 months ago

Suppose you have multiple NatTable instances that include the "Excel-like" filter row with caching enabled. Open a filter combo of one column, so the contents get loaded and the cache is for that column is set. Now close the other instance and replace the content of the NatTable instance for which the cache was populated before. The content change should trigger an update of the cache (technically a clear so it gets re-calculated). But nothing happens and you still see the filter combobox content of the previous table content.

The reason is in GlazedListsFilterRowComboBoxDataProvider#dispose(). There the static SCHEDULER is immediately shutdown, without checking if other instances are available. The Scheduler class should avoid this, but the direct call to shutdownNow() avoids the check.

I also noticed that in some scenarios (e.g. lazy loading is disabled and caching enabled) events are fired from a background thread. If a listener is added to the NatTable, that tries to update the UI, but the event is fired from the background thread, the Future gets an Exception and is killed. But that happens silently, and there is no indication that the Future is killed and what Exception caused this.