Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 195603 - [DataBinding] Observables fire change events when change hasn't occurred
Summary: [DataBinding] Observables fire change events when change hasn't occurred
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.3   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: 3.4 M2   Edit
Assignee: Brad Reynolds CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-05 22:07 EDT by Brad Reynolds CLA
Modified: 2007-09-08 23:58 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brad Reynolds CLA 2007-07-05 22:07:57 EDT
ButtonObservableValue doesn't diff the old and new values to determine if a change event should be fired.  The following test will fail but shouldn't.

    public void testFiresEventsWhenChanged() throws Exception {
    	Shell shell = new Shell();
    	Button button = new Button(shell, SWT.CHECK);
    	ButtonObservableValue observableValue = new ButtonObservableValue(button);
    	ValueChangeEventTracker tracker = new ValueChangeEventTracker();
    	observableValue.addValueChangeListener(tracker);
    	
    	assertEquals(Boolean.FALSE, observableValue.getValue());
    	button.notifyListeners(SWT.Selection, null);
    	
    	assertEquals(0, tracker.count);  //fails with count == 1
	}
Comment 1 Brad Reynolds CLA 2007-07-15 16:02:04 EDT
I'm finding others that exhibit this behavior as well.  I'm updating the summary to be more generic so that we don't have to log a bug for each.

Observables:
* ButtonObservableValue
* JavaBeanObservableValue

Comment 2 Brad Reynolds CLA 2007-07-21 21:52:39 EDT
Add to the list:
* CComboObservableValue (Text)
* CComboObservableValue (Selection)
* ComboObservableValue (Text)
* ComboObservableValue (Selection)
* CLabelObservableValue (Text)
Comment 3 Brad Reynolds CLA 2007-07-22 01:34:29 EDT
Add to the list:
* ScaleObservableValue (Minimum)
* ScaleObservableValue (Maximum)
* ScaleObservableValue (Selection)
* SpinnerObservableValue (Minimum)
* SpinnerObservableValue (Selection)
* TableSingleSelectionObservableValue
* TextEditableObservableValue (doesn't fire any change events - bug 197408)
Comment 4 Brad Reynolds CLA 2007-09-08 23:58:15 EDT
FIXED > 20070908.

This was fixed with the merge to HEAD of bug 182059.