Leniently allow constructor argument matches if required name is not resolvable
Issue: SPR-13987
This commit is contained in:
@@ -1612,12 +1612,14 @@ public class XmlBeanFactoryTests {
|
||||
assertEquals(0, ((String[]) bean.array).length);
|
||||
}
|
||||
|
||||
@Test @Ignore // TODO: SPR-13987
|
||||
@Test
|
||||
public void testConstructorWithUnresolvableParameterName() {
|
||||
DefaultListableBeanFactory xbf = new DefaultListableBeanFactory();
|
||||
new XmlBeanDefinitionReader(xbf).loadBeanDefinitions(CONSTRUCTOR_ARG_CONTEXT);
|
||||
AtomicInteger bean = (AtomicInteger) xbf.getBean("constructorUnresolvableName");
|
||||
assertEquals(1, bean.get());
|
||||
bean = (AtomicInteger) xbf.getBean("constructorUnresolvableNameWithIndex");
|
||||
assertEquals(1, bean.get());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
@@ -231,4 +231,8 @@
|
||||
<constructor-arg name="initialValue" value="1"/>
|
||||
</bean>
|
||||
|
||||
<bean id="constructorUnresolvableNameWithIndex" class="java.util.concurrent.atomic.AtomicInteger" scope="prototype">
|
||||
<constructor-arg index="0" name="initialValue" value="1"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
|
||||
Reference in New Issue
Block a user