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; }
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/observable/list/WritableListTest.java
public void testClearRealmChecks() throws Exception {
		RealmTester.exerciseCurrent(new Runnable() {
			public void run() {
				WritableList list = new WritableList();
				list.clear();
			}
		});
	}
	public void testNullElementType() throws Exception {
		RealmTester.setDefault(SWTObservables.getRealm(Display.getDefault()));
		WritableList writableList = new WritableList();
		assertNull(writableList.getElementType());
		writableList = new WritableList(Realm.getDefault());
		assertNull(writableList.getElementType());
	}
	public void testWithElementType() throws Exception {
		RealmTester.setDefault(SWTObservables.getRealm(Display.getDefault()));
		Object elementType = String.class;
		WritableList list = WritableList.withElementType(elementType);
		assertNotNull(list);
		assertEquals(Realm.getDefault(), list.getRealm());
		assertEquals(elementType, list.getElementType());
	}
	public static Test suite() {
		TestSuite suite = new TestSuite(WritableListTest.class.getName());
		suite.addTestSuite(WritableListTest.class);
		suite.addTest(MutableObservableListContractTest.suite(new Delegate()));
		return suite;
	}
	static class Delegate extends