Bug 152543 [DataBinding] ValueBinding NPE when update target from model is false
When a ValueBinding is constructed and instructed not to update the target from the model via the BindSpec a NPE is thrown when it tries to access the modelToTargetConverter. Exception in thread "main" java.lang.NullPointerException at org.eclipse.jface.internal.databinding.internal.ValueBinding.doUpdateTargetFromModel(ValueBinding.java:268) at org.eclipse.jface.internal.databinding.internal.ValueBinding.updateTargetFromModel(ValueBinding.java:250) at org.eclipse.jface.internal.databinding.internal.ValueBinding.<init>(ValueBinding.java:112) at Snippet.main(Snippet.java:32) Attaching patch...
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/internal/ValueBinding.java
ValidationError.class, null);
	private WritableValue validationErrorObservable = new WritableValue(
			ValidationError.class, null);
	/**
	 * @param context
	 * @param target
	 * @param model
	 * @param bindSpec
	 */
	public ValueBinding(DataBindingContext context, IObservableValue target,
			IObservableValue model, BindSpec bindSpec) {
		super(context);
		this.target = target;
		this.model = model;
		if (bindSpec.isUpdateTarget()) {
			modelToTargetConverter = bindSpec.getModelToTargetConverter();
			if (modelToTargetConverter == null) {
				throw new BindingException(
						"Missing model to target converter from " + model.getValueType() + " to " + target.getValueType()); 
			}
			if (!context.isAssignableFromTo(model.getValueType(),
					modelToTargetConverter.getFromType())) {
				throw new BindingException(
						"model to target converter does not convert from model type. Expected: " + model.getValueType() + ", actual: " + modelToTargetConverter.getFromType()); 
			}
			if (!context.isAssignableFromTo(modelToTargetConverter.getToType(),
					target.getValueType())) {
				throw new BindingException(
						"model to target converter does convert to target type. Expected: " + target.getValueType() + ", actual: " + modelToTargetConverter.getToType()); 
			}