Merge branch '6.1.x'
This commit is contained in:
commit
775a23b39d
|
@ -844,10 +844,18 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefinition mbd, boolean allowInit) {
|
protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefinition mbd, boolean allowInit) {
|
||||||
|
ResolvableType result;
|
||||||
|
|
||||||
// Check if the bean definition itself has defined the type with an attribute
|
// Check if the bean definition itself has defined the type with an attribute
|
||||||
ResolvableType result = getTypeForFactoryBeanFromAttributes(mbd);
|
try {
|
||||||
if (result != ResolvableType.NONE) {
|
result = getTypeForFactoryBeanFromAttributes(mbd);
|
||||||
return result;
|
if (result != ResolvableType.NONE) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException ex) {
|
||||||
|
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
|
||||||
|
String.valueOf(ex.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
// For instance supplied beans, try the target type and bean class immediately
|
// For instance supplied beans, try the target type and bean class immediately
|
||||||
|
|
|
@ -1712,9 +1712,15 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||||
* @see #getBean(String)
|
* @see #getBean(String)
|
||||||
*/
|
*/
|
||||||
protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefinition mbd, boolean allowInit) {
|
protected ResolvableType getTypeForFactoryBean(String beanName, RootBeanDefinition mbd, boolean allowInit) {
|
||||||
ResolvableType result = getTypeForFactoryBeanFromAttributes(mbd);
|
try {
|
||||||
if (result != ResolvableType.NONE) {
|
ResolvableType result = getTypeForFactoryBeanFromAttributes(mbd);
|
||||||
return result;
|
if (result != ResolvableType.NONE) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (IllegalArgumentException ex) {
|
||||||
|
throw new BeanDefinitionStoreException(mbd.getResourceDescription(), beanName,
|
||||||
|
String.valueOf(ex.getMessage()));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allowInit && mbd.isSingleton()) {
|
if (allowInit && mbd.isSingleton()) {
|
||||||
|
|
Loading…
Reference in New Issue