Bug 198101 [DataBinding] ComboObservableValue fails to clear cached value
ComboObservableValue fails to update cached currentValue during the doSetValue(...) call. As the result, event may not fire if the next combo selection happens to be the same as cached value. Proposed change (new lines end with // FIX): public void modifyText(ModifyEvent e) { if (!updating) { String oldValue = currentValue; currentValue = ComboObservableValue.this.combo.getText(); fireValueChange(Diffs.createValueDiff(oldValue, currentValue)); } else // FIX currentValue = ComboObservableValue.this.combo.getText(); // FIX
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/swt/CComboObservableValue.java
Assert.isTrue(attribute.equals(SWTProperties.TEXT)
				|| attribute.equals(SWTProperties.SELECTION),
				"unexpected attribute: " + attribute); 
		return String.class;
	}
	/**
	 * @return attribute being observed
	 */
	public String getAttribute() {
		return attribute;
	}
	/*
	 * (non-Javadoc)
	 *
	 * @see org.eclipse.core.databinding.observable.value.AbstractObservableValue#dispose()
	 */
	public synchronized void dispose() {
		super.dispose();
		if (modifyListener != null && !ccombo.isDisposed()) {
			ccombo.removeModifyListener(modifyListener);
		}
	}
	
	private void notifyIfChanged(String oldValue, String newValue) {
		if (!oldValue.equals(newValue)) {
			fireValueChange(Diffs.createValueDiff(oldValue, ccombo.getText()));			
		}
	}
}