Skip to content

Commit 058428a

Browse files
committed
Clarify how multiple attributes are treated by ConditionalOn(Missing)Bean
Closes gh-15177
1 parent d104205 commit 058428a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
import org.springframework.context.annotation.Conditional;
2828

2929
/**
30-
* {@link Conditional} that only matches when beans of the specified classes and/or with
31-
* the specified names are already contained in the {@link BeanFactory}.
30+
* {@link Conditional} that only matches when beans meeting all the specified requirements
31+
* are already contained in the {@link BeanFactory}. All the requirements must be met for
32+
* the condition to match, but they do not have to be met by the same bean.
3233
* <p>
3334
* When placed on a {@code @Bean} method, the bean class defaults to the return type of
3435
* the factory method:

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,9 @@
2727
import org.springframework.context.annotation.Conditional;
2828

2929
/**
30-
* {@link Conditional} that only matches when no beans of the specified classes and/or
31-
* with the specified names are already contained in the {@link BeanFactory}.
30+
* {@link Conditional} that only matches when no beans meeting the specified requirements
31+
* are already contained in the {@link BeanFactory}. None of the requirements must be met
32+
* for the condition to match and the requirements do not have to be met by the same bean.
3233
* <p>
3334
* When placed on a {@code @Bean} method, the bean class defaults to the return type of
3435
* the factory method:

0 commit comments

Comments
 (0)