From c10943c6538f88d5149b973d1b32c1a8e1f7cf2f Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 11 Feb 2016 15:05:07 +0100 Subject: [PATCH] Polish Javadoc Closes gh-4936 --- .../boot/autoconfigure/condition/ConditionalOnBean.java | 7 ++++++- .../autoconfigure/condition/ConditionalOnMissingBean.java | 7 ++++++- .../condition/ConditionalOnSingleCandidate.java | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBean.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBean.java index 9f3f765ec83..9b33f74e55d 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBean.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,11 @@ import org.springframework.context.annotation.Conditional; /** * {@link Conditional} that only matches when the specified bean classes and/or names are * already contained in the {@link BeanFactory}. + *

+ * The condition can only match the bean definitions that have been processed by the + * application context so far and, as such, it is strongly recommended to use this + * condition on auto-configuration classes only. If a candidate bean may be created by + * another auto-configuration, make sure that the one using this condition runs after. * * @author Phillip Webb */ diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBean.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBean.java index ff8bfca78f3..6e19649ae5b 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBean.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnMissingBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,6 +30,11 @@ import org.springframework.context.annotation.Conditional; /** * {@link Conditional} that only matches when the specified bean classes and/or names are * not already contained in the {@link BeanFactory}. + *

+ * The condition can only match the bean definitions that have been processed by the + * application context so far and, as such, it is strongly recommended to use this + * condition on auto-configuration classes only. If a candidate bean may be created by + * another auto-configuration, make sure that the one using this condition runs after. * * @author Phillip Webb * @author Andy Wilkinson diff --git a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java index 6300cf84762..cc8412b0d17 100644 --- a/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java +++ b/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnSingleCandidate.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,6 +33,11 @@ import org.springframework.context.annotation.Conditional; * The condition will also match if multiple matching bean instances are already contained * in the {@link BeanFactory} but a primary candidate has been defined; essentially, the * condition match if auto-wiring a bean with the defined type will succeed. + *

+ * The condition can only match the bean definitions that have been processed by the + * application context so far and, as such, it is strongly recommended to use this + * condition on auto-configuration classes only. If a candidate bean may be created by + * another auto-configuration, make sure that the one using this condition runs after. * * @author Stephane Nicoll * @since 1.3.0