Skip to content

Commit 9db4118

Browse files
GungnirLaevatainsbrannen
authored andcommitted
Fix DefaultListableBeanFactory#copyConfigurationFrom
Prior to this commit, the copyConfigurationFrom(ConfigurableBeanFactory) method in DefaultListableBeanFactory cloned its own AutowireCandidateResolver type instead of the resolver type from the supplied ConfigurableBeanFactory. This commit fixes that by cloning the resolver type from the supplied ConfigurableBeanFactory. Closes gh-23569
1 parent b159ef6 commit 9db4118

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ public void copyConfigurationFrom(ConfigurableBeanFactory otherFactory) {
321321
this.allowEagerClassLoading = otherListableFactory.allowEagerClassLoading;
322322
this.dependencyComparator = otherListableFactory.dependencyComparator;
323323
// A clone of the AutowireCandidateResolver since it is potentially BeanFactoryAware...
324-
setAutowireCandidateResolver(BeanUtils.instantiateClass(getAutowireCandidateResolver().getClass()));
324+
setAutowireCandidateResolver(BeanUtils.instantiateClass(otherListableFactory.getAutowireCandidateResolver().getClass()));
325325
// Make resolvable dependencies (e.g. ResourceLoader) available here as well...
326326
this.resolvableDependencies.putAll(otherListableFactory.resolvableDependencies);
327327
}

0 commit comments

Comments
 (0)