Merge branch '6.1.x'

# Conflicts:
#	framework-platform/framework-platform.gradle
This commit is contained in:
Juergen Hoeller
2024-04-29 18:05:40 +02:00
4 changed files with 19 additions and 17 deletions

View File

@@ -321,7 +321,8 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
// requested (indicated by required type), not for depends-on cascades.
throw new BeanCreationException(mbd.getResourceDescription(), beanName,
"Failed to initialize dependency '" + ex.getBeanName() + "' of " +
requiredType.getSimpleName() + " bean '" + beanName + "'", ex);
requiredType.getSimpleName() + " bean '" + beanName + "': " +
ex.getMessage(), ex);
}
throw ex;
}

View File

@@ -227,9 +227,8 @@ public final class RegisteredBean {
if (executable instanceof Method method && !Modifier.isStatic(method.getModifiers())) {
String factoryBeanName = getMergedBeanDefinition().getFactoryBeanName();
if (factoryBeanName != null && this.beanFactory.containsBean(factoryBeanName)) {
Class<?> target = this.beanFactory.getMergedBeanDefinition(factoryBeanName)
.getResolvableType().toClass();
return new InstantiationDescriptor(executable, target);
return new InstantiationDescriptor(executable,
this.beanFactory.getMergedBeanDefinition(factoryBeanName).getResolvableType().toClass());
}
}
return new InstantiationDescriptor(executable, executable.getDeclaringClass());
@@ -260,8 +259,9 @@ public final class RegisteredBean {
.append("mergedBeanDefinition", getMergedBeanDefinition()).toString();
}
/**
* Describe how a bean should be instantiated. While the {@code targetClass}
* Descriptor for how a bean should be instantiated. While the {@code targetClass}
* is usually the declaring class of the {@code executable}, there are cases
* where retaining the actual concrete type is necessary.
* @param executable the {@link Executable} to invoke
@@ -275,6 +275,7 @@ public final class RegisteredBean {
}
}
/**
* Resolver used to obtain inner-bean details.
*/