Polish contribution

See gh-36831
This commit is contained in:
Sam Brannen
2026-05-27 12:02:50 +02:00
parent f3bfe27445
commit c17939ed5c
2 changed files with 20 additions and 20 deletions
@@ -612,15 +612,15 @@ javadoc for more detail.
[NOTE]
====
A `@Conditional` declared on an enclosing `@Configuration` class gates the
registration of nested `@Configuration` classes within it only when the
nested class is reached through the parser's recursion from its enclosing
class, or through `@Import`. When the nested class is discovered
independently of its enclosing class, for example via `@ComponentScan` or
by directly registering it against the application context, it is processed
using only its own `@Conditional` annotations. In that case, redeclare the
relevant conditions on the nested class, or extract them into a composed
annotation applied to both, if the same gating is intended.
A `@Conditional` annotation declared on an enclosing `@Configuration` class is only
applied to the registration of a nested `@Configuration` class if the nested class is
reached through the parser's recursion from its enclosing class, or via `@Import`. If a
nested class is discovered independently of its enclosing class — for example, via
`@ComponentScan` or by directly registering it against the application context — it is
processed using only its own `@Conditional` annotations. Thus, if you wish to ensure that
the same `@Conditional` annotations apply in such scenarios, you must redeclare the
relevant annotations on the nested class, or extract them into a composed annotation
which you apply to both the enclosing class and the nested class.
====
@@ -341,17 +341,17 @@ import org.springframework.stereotype.Component;
* with the {@code @Profile} annotation to provide two options of the same bean to the
* enclosing {@code @Configuration} class.
*
* <p>{@link Conditional @Conditional} annotations declared on an enclosing
* {@code @Configuration} class gate registration of any nested
* {@code @Configuration} classes within it when the nested class is reached
* through the parser's recursion from its enclosing class (the case shown
* above) or via {@link Import @Import}. When the nested class is discovered
* independently of its enclosing class, for example via
* {@link ComponentScan @ComponentScan} or by directly registering the nested
* class against the application context, it is processed using only its own
* {@code @Conditional} annotations. In that case, redeclare the relevant
* conditions on the nested class, or extract them into a composed
* annotation applied to both, if the same gating is intended.
* <p>A {@link Conditional @Conditional} annotation declared on an enclosing
* {@code @Configuration} class is only applied to the registration of a nested
* {@code @Configuration} class if the nested class is reached through the parser's
* recursion from its enclosing class, or via {@link Import @Import}. If a nested
* class is discovered independently of its enclosing class &mdash; for example,
* via {@link ComponentScan @ComponentScan} or by directly registering it against
* the application context &mdash; it is processed using only its own
* {@code @Conditional} annotations. Thus, if you wish to ensure that the same
* {@code @Conditional} annotations apply in such scenarios, you must redeclare
* the relevant annotations on the nested class, or extract them into a composed
* annotation which you apply to both the enclosing class and the nested class.
*
* <h2>Configuring lazy initialization</h2>
*