Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 194734 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/core/databinding/property/set/SimpleSetPropertyObservableSet.java (-2 / +9 lines)
Lines 368-376 Link Here
368
	private void notifyIfChanged(SetDiff diff) {
368
	private void notifyIfChanged(SetDiff diff) {
369
		if (hasListeners()) {
369
		if (hasListeners()) {
370
			Set oldSet = cachedSet;
370
			Set oldSet = cachedSet;
371
			Set newSet = cachedSet = property.getSet(source);
371
			Set newSet;
372
			if (diff == null)
372
			if (diff == null) {
373
				newSet = property.getSet(source);
373
				diff = Diffs.computeSetDiff(oldSet, newSet);
374
				diff = Diffs.computeSetDiff(oldSet, newSet);
375
			} else {
376
				newSet = new HashSet(oldSet);
377
				diff.applyTo(newSet);
378
			}
379
			cachedSet = newSet;
380
374
			if (!diff.isEmpty())
381
			if (!diff.isEmpty())
375
				fireSetChange(diff);
382
				fireSetChange(diff);
376
		}
383
		}
(-)src/org/eclipse/core/databinding/property/value/SimpleValuePropertyObservableValue.java (-8 / +7 lines)
Lines 59-65 Link Here
59
								if (!isDisposed() && !updating) {
59
								if (!isDisposed() && !updating) {
60
									getRealm().exec(new Runnable() {
60
									getRealm().exec(new Runnable() {
61
										public void run() {
61
										public void run() {
62
											notifyIfChanged((ValueDiff) event.diff);
62
											notifyIfChanged();
63
										}
63
										}
64
									});
64
									});
65
								}
65
								}
Lines 78-84 Link Here
78
	}
78
	}
79
79
80
	protected Object doGetValue() {
80
	protected Object doGetValue() {
81
		notifyIfChanged(null);
81
		notifyIfChanged();
82
		return property.getValue(source);
82
		return property.getValue(source);
83
	}
83
	}
84
84
Lines 90-107 Link Here
90
			updating = false;
90
			updating = false;
91
		}
91
		}
92
92
93
		notifyIfChanged(null);
93
		notifyIfChanged();
94
	}
94
	}
95
95
96
	private void notifyIfChanged(ValueDiff diff) {
96
	private void notifyIfChanged() {
97
		if (hasListeners()) {
97
		if (hasListeners()) {
98
			Object oldValue = cachedValue;
98
			Object oldValue = cachedValue;
99
			Object newValue = cachedValue = property.getValue(source);
99
			Object newValue = cachedValue = property.getValue(source);
100
			if (diff == null)
100
			ValueDiff diff = Diffs.createValueDiff(oldValue, newValue);
101
				diff = Diffs.createValueDiff(oldValue, newValue);
101
102
			if (hasListeners() && !Util.equals(oldValue, newValue)) {
102
			if (!Util.equals(oldValue, newValue))
103
				fireValueChange(diff);
103
				fireValueChange(diff);
104
			}
105
		}
104
		}
106
	}
105
	}
107
106
(-)src/org/eclipse/core/databinding/property/list/SimpleListPropertyObservableList.java (-4 / +10 lines)
Lines 626-637 Link Here
626
	private void notifyIfChanged(ListDiff diff) {
626
	private void notifyIfChanged(ListDiff diff) {
627
		if (hasListeners()) {
627
		if (hasListeners()) {
628
			List oldList = cachedList;
628
			List oldList = cachedList;
629
			List newList = cachedList = property.getList(source);
629
			List newList;
630
			if (diff == null)
630
			if (diff == null) {
631
				newList = property.getList(source);
631
				diff = Diffs.computeListDiff(oldList, newList);
632
				diff = Diffs.computeListDiff(oldList, newList);
632
			if (!diff.isEmpty()) {
633
			} else {
633
				fireListChange(diff);
634
				newList = new ArrayList(oldList);
635
				diff.applyTo(newList);
634
			}
636
			}
637
			cachedList = newList;
638
639
			if (!diff.isEmpty())
640
				fireListChange(diff);
635
		}
641
		}
636
	}
642
	}
637
643
(-)src/org/eclipse/core/databinding/property/map/SimpleMapPropertyObservableMap.java (-2 / +9 lines)
Lines 267-275 Link Here
267
	private void notifyIfChanged(MapDiff diff) {
267
	private void notifyIfChanged(MapDiff diff) {
268
		if (hasListeners()) {
268
		if (hasListeners()) {
269
			Map oldMap = cachedMap;
269
			Map oldMap = cachedMap;
270
			Map newMap = cachedMap = property.getMap(source);
270
			Map newMap;
271
			if (diff == null)
271
			if (diff == null) {
272
				newMap = property.getMap(source);
272
				diff = Diffs.computeMapDiff(oldMap, newMap);
273
				diff = Diffs.computeMapDiff(oldMap, newMap);
274
			} else {
275
				newMap = new HashMap(oldMap);
276
				diff.applyTo(newMap);
277
			}
278
			cachedMap = newMap;
279
273
			if (!diff.isEmpty())
280
			if (!diff.isEmpty())
274
				fireMapChange(diff);
281
				fireMapChange(diff);
275
		}
282
		}

Return to bug 194734