Community
Participate
Working Groups
We set up a somewhat complex data binding scenario, where we need to manage multiple computed collections together. With list implementations, we simply put ComputedLists into a MultiList, and everything works as expected. On the other hand, when putting ComputedSets into a UnionSet, we experience missing change notifications. After some debugging, we found that the change notifications are not propagated properly between the ComputedSets and UnionSets, and we also managed to create a short application that reproduces it: https://gist.github.com/ujhelyiz/6124893/325ec18738ff6d679e4d3b37c8713294521ee6be Our basic problem is that the ISetChangeListener of the UnionSet is not called if the change originates from a ComputedSet; however, each case the Sets are queried, the result is correct. We are not sure whether we missed something, or maybe we found a bug in JFace Data Binding. (Originally from http://www.eclipse.org/forums/index.php/mv/msg/496665/) Additional details: As far as we see, the ComputedSet.makeDirty is called when there is a change, it calls makeStale() and during that the StalenessListeners (which are registered by the UnionSet probably) are called, at some point during the listeners, the calculate() method is called on the ComputedSet, which overwrites cachedSet with the new values. When makeStale() returns in makeDirty, the value of cachedSet is used as the oldSet but at this point, cachedSet already contains the new values and the difference will be empty.
Created attachment 235655 [details] Proposed minimal change I have modified the current ComputedSet implementation to store its old values before calling makeStale(), as StalenessTrackers call isStale() on their dependencies, which in turn runs doGetSet() and overwrites the cached value. All tests in org.eclipse.jface.tests.databinding still pass.
(In reply to Abel Hegedus from comment #1) > Created attachment 235655 [details] > Proposed minimal change Abel, if you sign your CLA we can push your change. PW
Thanks, I have signed the CLA.
Released as http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=69ebc69aecd2f89760f5a102fc5d57f0b5092f71 Thanks Abel. PW
Verified in I20131028-2000.