From 834ebc44f8ddef719603f6f1ed70ef83bb337f2a Mon Sep 17 00:00:00 2001 From: SchutzeHades Date: Thu, 14 Nov 2019 16:57:45 +0800 Subject: [PATCH] Fix inappropriate eager init. --- .../beans/factory/support/DefaultListableBeanFactory.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java index 4f6dc67744bf..746b4367a9f3 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java @@ -473,10 +473,10 @@ public String[] getBeanNamesForType(ResolvableType type) { public String[] getBeanNamesForType(ResolvableType type, boolean includeNonSingletons, boolean allowEagerInit) { Class resolved = type.resolve(); if (resolved != null && !type.hasGenerics()) { - return getBeanNamesForType(resolved, includeNonSingletons, includeNonSingletons); + return getBeanNamesForType(resolved, includeNonSingletons, allowEagerInit); } else { - return doGetBeanNamesForType(type, includeNonSingletons, includeNonSingletons); + return doGetBeanNamesForType(type, includeNonSingletons, allowEagerInit); } }