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
public boolean removeAll(Collection c) {
		checkRealm();
		List entries = new ArrayList();
		for (Iterator it = c.iterator(); it.hasNext();) {
			Object element = it.next();
			int removeIndex = wrappedList.indexOf(element);
			if (removeIndex != -1) {
				wrappedList.remove(removeIndex);
				entries.add(Diffs.createListDiffEntry(removeIndex, false,
						element));
			}
		}
		if (entries.size() > 0)
			fireListChange(Diffs.createListDiff((ListDiffEntry[]) entries
					.toArray(new ListDiffEntry[entries.size()])));
		return entries.size() > 0;
	}
	public boolean retainAll(Collection c) {
		checkRealm();
		List entries = new ArrayList();
		int removeIndex = 0;
		for (Iterator it = wrappedList.iterator(); it.hasNext();) {
			Object element = it.next();
			if (!c.contains(element)) {
				entries.add(Diffs.createListDiffEntry(removeIndex, false,
						element));
				it.remove();
			} else {
				
				removeIndex++;