Bug 135316 [DataBinding] Unexpected behavior from BindSpec converter and validator setters
The set methods that accept one validator/converter don't behave as expected. For example if setValidators(...) was called with 2 validators and then setValidator(...) was called it would only change the first validator stored internally. The validator that previously was set at index 1 in the array is still maintained by BindSpec. Also the setValidator(...) method always assumes that an array with at least a length of 1 exists. If setValidators(...) is called with an array of length zero and then a call is made to setValidator(...) an IndexOutOfBoundsException is thrown. Same problems would occur with setting it to null except of course a NPE will be thrown. When I get some time I'll try to apply a patch for this. The changes that I'll make will be that when any set is called it removes all previous values.
bundles/org.eclipse.jface.databinding/src/org/eclipse/jface/internal/databinding/provisional/BindSpec.java
/*******************************************************************************
 * Copyright (c) 2005, 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jface.internal.databinding.provisional;
import org.eclipse.jface.internal.databinding.provisional.conversion.IConverter;
import org.eclipse.jface.internal.databinding.provisional.observable.LazyInsertDeleteProvider;
import org.eclipse.jface.internal.databinding.provisional.validation.IDomainValidator;
import org.eclipse.jface.internal.databinding.provisional.validation.IValidator;
/**
 * Data binding has three concerns, the target, the model, and the data flow
 * between the target and model.  BindSpec contains values and settings that
 * influence how data binding manages this data flow between the target and
 * the model.
 * 
 * @since 3.2
 */
public class BindSpec {