This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 414297 - [DataBinding] missing SetChanged notification
Summary: [DataBinding] missing SetChanged notification
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.3   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Paul Webster CLA
QA Contact: Wojciech Sudol CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-02 08:15 EDT by Abel Hegedus CLA
Modified: 2013-10-30 09:28 EDT (History)
3 users (show)

See Also:


Attachments
Proposed minimal change (1.32 KB, patch)
2013-09-20 06:18 EDT, Abel Hegedus CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Abel Hegedus CLA 2013-08-02 08:15:02 EDT
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.
Comment 1 Abel Hegedus CLA 2013-09-20 06:18:55 EDT
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.
Comment 2 Paul Webster CLA 2013-09-27 11:02:29 EDT
(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
Comment 3 Abel Hegedus CLA 2013-09-27 12:03:53 EDT
Thanks, I have signed the CLA.
Comment 5 Wojciech Sudol CLA 2013-10-30 09:28:32 EDT
Verified in I20131028-2000.