Bug 256422 [DataBinding] doSetValue in WritableValue
I have redefined equals() and hashcode() method in my own Object. So two different instances (i1 and i2) can be equals. I create an WritableValue w initialize with i1. When I tried w.setValue(i2) and I get the value with w.getvalue(), i1 as returned instead of i2. DoSetValue in Writable value : public void doSetValue(Object value) { boolean changed = false; if (this.value == null && value != null) { changed = true; } else if (this.value != null && !this.value.equals(value)) { changed = true; } if (changed) { fireValueChange(Diffs.createValueDiff(this.value, this.value = value)); } } Can you change "!this.value.equals(value)" by "this.value != value ", please ?
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/value/WritableValue.java
public Object doGetValue() {
		return value;
	}
	/**
	 * @param value
	 *            The value to set.
	 */
	public void doSetValue(Object value) {
        boolean changed = false;
        if (this.value == null && value != null) {
            changed = true;
        } else if (this.value != null && !this.value.equals(value)) {
            changed = true;
        }
        if (changed) {
            fireValueChange(Diffs.createValueDiff(this.value, this.value = value));
        }
	}
	public Object getValueType() {
		return valueType;
	}
	/**
	 * @param elementType can be <code>null</code>
	 * @return new instance with the default realm and a value of <code>null</code>
	 */
	public static WritableValue withValueType(Object elementType) {
		return new WritableValue(Realm.getDefault(), null, elementType);
	}
}