Bug 213848 [DataBinding] WritableSet behaves different to WritableList
Build ID: M20071023-1652 Steps To Reproduce: When I construct a WritableList from a List then the list is wrapped. When I do this with a Set then it is copied to a new Set and changes to the WritableSet are not reflected in the original Set anymore whiich is very nasty as one needs to copy back the writeableset. More information: public WritableSet(Realm realm, Collection c, Object elementType) { super(realm, new HashSet(c), elementType); this.elementType = elementType; } should have a constructor like public WritableSet(Realm realm, Set set, Object elementType) { super(realm, set, elementType); this.elementType = elementType; }
bundles/org.eclipse.core.databinding.observable/src/org/eclipse/core/databinding/observable/list/WritableList.java
super(realm, toWrap, elementType);
	}
	public Object set(int index, Object element) {
		checkRealm();
		Object oldElement = wrappedList.set(index, element);
		fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(index,
				false, oldElement), Diffs.createListDiffEntry(index, true,
				element)));
		return oldElement;
	}
	/**
	 * @since 1.1
	 */
	public Object move(int oldIndex, int newIndex) {
		checkRealm();
		int size = wrappedList.size();
		if (oldIndex < 0 || oldIndex >= size)
			throw new IndexOutOfBoundsException(
					"oldIndex: " + oldIndex + ", size:" + size); 
		if (newIndex < 0 || newIndex >= size)
			throw new IndexOutOfBoundsException(
					"newIndex: " + newIndex + ", size:" + size); 
		if (oldIndex == newIndex)
			return wrappedList.get(oldIndex);
		Object element = wrappedList.remove(oldIndex);
		wrappedList.add(newIndex, element);
		fireListChange(Diffs.createListDiff(Diffs.createListDiffEntry(oldIndex,
				false, element), Diffs.createListDiffEntry(newIndex, true,
				element)));
		return element;