Bug 177264 [DataBinding] Failure in DefaultBindSupportFactoryBooleanPrimitiveTest.testStringToBooleanPrimitiveConverter against Eclipse 3.2.2
When ran against 3.2.2 the following failure is reported for DefaultBindSupportFactoryBooleanPrimitiveTest.testStringToBooleanPrimitiveConverter. The issue is that in 3.2.2 Status.setMessage(...) doesn't allow null for the message. In 3.3 if null is passed on construction it is defaulted to "". We need to default "" when constructing Statuses if the Exception's message is null. The line causing this issue is ValueBinding 169 when a NPE is caught. junit.framework.AssertionFailedError: Errors should be found, but found none. at junit.framework.Assert.fail(Assert.java:47) at junit.framework.Assert.assertTrue(Assert.java:20) at junit.framework.Assert.assertFalse(Assert.java:34) at org.eclipse.jface.internal.databinding.provisional.factories.AbstractBindSupportFactoryTest.assertErrorsFound(AbstractBindSupportFactoryTest.java:40) at org.eclipse.jface.internal.databinding.provisional.factories.DefaultBindSupportFactoryBooleanPrimitiveTest.testStringToBooleanPrimitiveConverter(DefaultBindSupportFactoryBooleanPrimitiveTest.java:52) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.pde.internal.junit.runtime.RemotePluginTestRunner.main(RemotePluginTestRunner.java:58) at org.eclipse.pde.internal.junit.runtime.CoreTestApplication.run(CoreTestApplication.java:24) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:78) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:92) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:68) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:177) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.eclipse.core.launcher.Main.invokeFramework(Main.java:336) at org.eclipse.core.launcher.Main.basicRun(Main.java:280) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952)
bundles/org.eclipse.core.databinding/src/org/eclipse/core/databinding/ValueBinding.java
}
						} catch (Exception ex) {
							statusHolder[0] = new Status(IStatus.ERROR,
									Policy.JFACE_DATABINDING, IStatus.ERROR, ex
											.getMessage(), ex);
						} finally {
							if (!destinationRealmReached) {
								setValidationStatus(statusHolder[0]);
							}
						}
					}
				});
			}
		}
	}
	public void validateModelToTarget() {
		doUpdate(model, target, modelToTarget, true, true);
	}
	public void validateTargetToModel() {
		doUpdate(target, model, targetToModel, true, true);
	}
	private void setValidationStatus(final IStatus status) {
		validationStatusObservable.getRealm().exec(new Runnable() {
			public void run() {
				validationStatusObservable.setValue(status);
			}
		});
	}
}