Polishing

This commit is contained in:
Juergen Hoeller 2024-04-29 18:02:44 +02:00
parent 0ac04a7f86
commit 3cf2cd70ab
1 changed files with 5 additions and 4 deletions

View File

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