Try type conversion for unique fallback write method as well
Closes gh-32329 See gh-32159
This commit is contained in:
@@ -1342,6 +1342,11 @@ class DefaultListableBeanFactoryTests {
|
||||
rbd.getPropertyValues().add("value", Duration.ofSeconds(1000));
|
||||
lbf.registerBeanDefinition("overloaded", rbd);
|
||||
assertThat(lbf.getBean(SetterOverload.class).getObject()).isEqualTo("1000s");
|
||||
|
||||
rbd = new RootBeanDefinition(SetterOverload.class);
|
||||
rbd.getPropertyValues().add("value", "1000");
|
||||
lbf.registerBeanDefinition("overloaded", rbd);
|
||||
assertThat(lbf.getBean(SetterOverload.class).getObject()).isEqualTo("1000i");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -3369,13 +3374,13 @@ class DefaultListableBeanFactoryTests {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
public void setValue(int length) {
|
||||
this.value = length + "i";
|
||||
}
|
||||
|
||||
public void setValue(Duration duration) {
|
||||
this.value = duration.getSeconds() + "s";
|
||||
}
|
||||
|
||||
public void setValue(int length) {
|
||||
this.value = length + "i";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user