do not insist on BeanDefinition presence for @Value resolution (for use in unit tests; SPR-6918)
This commit is contained in:
parent
ff09482653
commit
b8c0e153e3
|
|
@ -1242,7 +1242,7 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||||
if (this.beanExpressionResolver == null) {
|
if (this.beanExpressionResolver == null) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
Scope scope = getRegisteredScope(beanDefinition.getScope());
|
Scope scope = (beanDefinition != null ? getRegisteredScope(beanDefinition.getScope()) : null);
|
||||||
return this.beanExpressionResolver.evaluate(value, new BeanExpressionContext(this, scope));
|
return this.beanExpressionResolver.evaluate(value, new BeanExpressionContext(this, scope));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -694,7 +694,8 @@ public class DefaultListableBeanFactory extends AbstractAutowireCapableBeanFacto
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
if (value instanceof String) {
|
if (value instanceof String) {
|
||||||
String strVal = resolveEmbeddedValue((String) value);
|
String strVal = resolveEmbeddedValue((String) value);
|
||||||
value = evaluateBeanDefinitionString(strVal, getMergedBeanDefinition(beanName));
|
BeanDefinition bd = (containsBean(beanName) ? getMergedBeanDefinition(beanName) : null);
|
||||||
|
value = evaluateBeanDefinitionString(strVal, bd);
|
||||||
}
|
}
|
||||||
TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
|
TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
|
||||||
return converter.convertIfNecessary(value, type);
|
return converter.convertIfNecessary(value, type);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue