Skip to content

Commit 682ad66

Browse files
committed
Fix 'Check scoped proxy target for isDefaultCandidate'
Fix accidental logic issue introduced in commit c14b57a. See gh-47633
1 parent c14b57a commit 682ad66

File tree

1 file changed

+2
-2
lines changed
  • spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition

1 file changed

+2
-2
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/OnBeanCondition.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,10 +270,10 @@ private Set<String> matchedNamesFrom(Map<String, BeanDefinition> namedDefinition
270270

271271
private boolean isCandidate(ConfigurableListableBeanFactory beanFactory, String name, BeanDefinition definition,
272272
Set<String> ignoredBeans) {
273-
if (ignoredBeans.contains(name) || definition == null) {
273+
if (ignoredBeans.contains(name)) {
274274
return false;
275275
}
276-
if (definition.isAutowireCandidate() && isDefaultCandidate(definition)) {
276+
if (definition == null || (definition.isAutowireCandidate() && isDefaultCandidate(definition))) {
277277
return true;
278278
}
279279
if (ScopedProxyUtils.isScopedTarget(name)) {

0 commit comments

Comments
 (0)