Bug 237884 [DataBinding] NPE in when disposing MultiValidator instance
Build ID: I20080502-0100 Steps To Reproduce: 1.Creating an instance of a subclass of MultiValidator e.g. MultiValidator myValidator = new MultiValidator() { validate() { return Status.OK; }} 2.Calling dispose before calling getValidationStatus() -> NPE in dispose() method (unmodifiableValidationStatus.dispose();) More information:
tests/org.eclipse.jface.tests.databinding/src/org/eclipse/core/tests/databinding/validation/MultiValidatorTest.java
validator.observeValidatedValue(null);
			fail("Expected AssertionFailedException");
		} catch (AssertionFailedException expected) {
		}
	}
	public void testObserveValidatedValue_WrongRealm() {
		Realm otherRealm = new CurrentRealm(true);
		try {
			validator.observeValidatedValue(new WritableValue(otherRealm));
			fail("Expected AssertionFailedException");
		} catch (AssertionFailedException expected) {
		}
	}
	public void testObserveValidatedValue_ReturnValue() {
		WritableValue target = new WritableValue();
		ValidatedObservableValue validated = (ValidatedObservableValue) validator
				.observeValidatedValue(target);
		target.setValue(new Object());
		assertEquals(target.getValue(), validated.getValue());
		dependency.setValue(ValidationStatus.error("error"));
		assertFalse(validated.isStale());
		target.setValue(new Object());
		assertTrue(validated.isStale());
		assertFalse(target.getValue().equals(validated.getValue()));
		dependency.setValue(ValidationStatus.info("info")); 
		assertEquals(target.getValue(), validated.getValue());
		assertFalse(validated.isStale());
	}
}