You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/condition/ConditionalOnExpression.java
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2012-2019 the original author or authors.
2
+
* Copyright 2012-2022 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -27,6 +27,11 @@
27
27
/**
28
28
* Configuration annotation for a conditional element that depends on the value of a SpEL
29
29
* expression.
30
+
* <p>
31
+
* Referencing a bean in the expression will cause that bean to be initialized very early
32
+
* in context refresh processing. As a result, the bean won't be eligible for
33
+
* post-processing (such as configuration properties binding) and its state may be
Copy file name to clipboardExpand all lines: spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/developing-auto-configuration.adoc
+3Lines changed: 3 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -143,6 +143,9 @@ This condition will not match for applications that are run with an embedded ser
143
143
==== SpEL Expression Conditions
144
144
The `@ConditionalOnExpression` annotation lets configuration be included based on the result of a {spring-framework-docs}/core.html#expressions[SpEL expression].
145
145
146
+
NOTE: Referencing a bean in the expression will cause that bean to be initialized very early in context refresh processing.
147
+
As a result, the bean won't be eligible for post-processing (such as configuration properties binding) and its state may be incomplete.
0 commit comments