diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java index 42bb0c3e100..c836c373e3a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java @@ -61,6 +61,7 @@ import org.springframework.beans.factory.config.AutowiredPropertyMarker; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanPostProcessor; import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.beans.factory.config.ConstructorArgumentValues; import org.springframework.beans.factory.config.DependencyDescriptor; import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessor; @@ -1221,7 +1222,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac this.currentlyCreatedBean.set(beanName); try { if (supplier instanceof InstanceSupplier instanceSupplier) { - return instanceSupplier.get(RegisteredBean.of(this, beanName)); + return instanceSupplier.get(RegisteredBean.of((ConfigurableListableBeanFactory) this, beanName)); } if (supplier instanceof ThrowingSupplier throwableSupplier) { return throwableSupplier.getWithException(); diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/RegisteredBean.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/RegisteredBean.java index 1de3defeae6..d4ff6f070ea 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/RegisteredBean.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/RegisteredBean.java @@ -22,7 +22,7 @@ import java.util.function.Supplier; import org.springframework.beans.factory.BeanFactory; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.beans.factory.config.BeanDefinitionHolder; -import org.springframework.beans.factory.config.ConfigurableBeanFactory; +import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; import org.springframework.core.ResolvableType; import org.springframework.core.style.ToStringCreator; import org.springframework.lang.Nullable; @@ -41,7 +41,7 @@ import org.springframework.util.StringUtils; */ public final class RegisteredBean { - private final ConfigurableBeanFactory beanFactory; + private final ConfigurableListableBeanFactory beanFactory; private final Supplier beanName; @@ -53,7 +53,7 @@ public final class RegisteredBean { private final RegisteredBean parent; - private RegisteredBean(ConfigurableBeanFactory beanFactory, Supplier beanName, + private RegisteredBean(ConfigurableListableBeanFactory beanFactory, Supplier beanName, boolean generatedBeanName, Supplier mergedBeanDefinition, @Nullable RegisteredBean parent) { @@ -71,7 +71,7 @@ public final class RegisteredBean { * @param beanName the bean name * @return a new {@link RegisteredBean} instance */ - public static RegisteredBean of(ConfigurableBeanFactory beanFactory, + public static RegisteredBean of(ConfigurableListableBeanFactory beanFactory, String beanName) { Assert.notNull(beanFactory, "'beanFactory' must not be null"); @@ -149,7 +149,7 @@ public final class RegisteredBean { * Return the bean factory containing the bean. * @return the bean factory */ - public ConfigurableBeanFactory getBeanFactory() { + public ConfigurableListableBeanFactory getBeanFactory() { return this.beanFactory; } @@ -172,7 +172,7 @@ public final class RegisteredBean { /** * Return the merged bean definition of the bean. * @return the merged bean definition - * @see ConfigurableBeanFactory#getMergedBeanDefinition(String) + * @see ConfigurableListableBeanFactory#getMergedBeanDefinition(String) */ public RootBeanDefinition getMergedBeanDefinition() { return this.mergedBeanDefinition.get();