.map(descriptor -> new BeanPropertyDefinition<>(this,
instanceKey.type, descriptor))
.collect(Collectors.toMap(PropertyDefinition::getName,
- Function.identity()));
+ Function.identity(), (pd1, pd2) -> pd2));
} catch (IntrospectionException e) {
throw new IllegalArgumentException(
"Cannot find property descriptors for "
import com.vaadin.data.BeanBinderTest.RequiredConstraints.SubConstraint;
import com.vaadin.data.BeanBinderTest.RequiredConstraints.SubSubConstraint;
+import com.vaadin.data.BinderInstanceFieldTest.IntegerTextField;
import com.vaadin.data.converter.StringToIntegerConverter;
import com.vaadin.tests.data.bean.BeanToValidate;
import com.vaadin.ui.CheckBoxGroup;
private TextField mydate = new TextField();
}
+ public interface TestInterface {
+ int getProperty();
+ }
+
+ public interface TestInterfaceWithOverwrittenMethod extends TestInterface {
+ @Override
+ int getProperty();
+ }
+
@Before
public void setUp() {
binder = new BeanValidationBinder<>(BeanToValidate.class);
assertTrue(binder.validate().isOk());
}
+ @Test
+ public void interface_extension_with_overwritten_property() {
+ Binder<TestInterfaceWithOverwrittenMethod> binder = new Binder<>(
+ TestInterfaceWithOverwrittenMethod.class);
+ IntegerTextField field = new IntegerTextField();
+
+ binder.bind(field, "property");
+ TestInterfaceWithOverwrittenMethod bean = new TestInterfaceWithOverwrittenMethod() {
+ @Override
+ public int getProperty() {
+ return 5;
+ }
+ };
+ binder.setBean(bean);
+
+ assertEquals(Integer.valueOf(5), field.getValue());
+ }
+
private void assertInvalid(HasValue<?> field, String message) {
BinderValidationStatus<?> status = binder.validate();
List<BindingValidationStatus<?>> errors = status