diff --git a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java b/spring-context/src/main/java/org/springframework/context/annotation/Bean.java index cc57a06845d..35b17ac8652 100644 --- a/spring-context/src/main/java/org/springframework/context/annotation/Bean.java +++ b/spring-context/src/main/java/org/springframework/context/annotation/Bean.java @@ -78,7 +78,7 @@ import org.springframework.core.annotation.AliasFor; * * * The semantics of the above-mentioned annotations match their use at the component - * class level: {@code Profile} allows for selective inclusion of certain beans. + * class level: {@code @Profile} allows for selective inclusion of certain beans. * {@code @Scope} changes the bean's scope from singleton to the specified scope. * {@code @Lazy} only has an actual effect in case of the default singleton scope. * {@code @DependsOn} enforces the creation of specific other beans before this @@ -96,12 +96,12 @@ import org.springframework.core.annotation.AliasFor; * order values determine the order of resolved elements in case of collection * injection points (with several target beans matching by type and qualifier). * - *

NOTE: {@code @Order} values may influence priorities at injection points + *

NOTE: {@code @Order} values may influence priorities at injection points, * but please be aware that they do not influence singleton startup order which is an * orthogonal concern determined by dependency relationships and {@code @DependsOn} * declarations as mentioned above. Also, {@link javax.annotation.Priority} is not * available at this level since it cannot be declared on methods; its semantics can - * be modelled through {@code @Order} values in combination with {@code @Primary} on + * be modeled through {@code @Order} values in combination with {@code @Primary} on * a single bean per type. * *

{@code @Bean} Methods in {@code @Configuration} Classes

diff --git a/spring-core/src/main/java/org/springframework/core/annotation/Order.java b/spring-core/src/main/java/org/springframework/core/annotation/Order.java index 47b182b1594..13a6624646f 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/Order.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/Order.java @@ -42,7 +42,7 @@ import org.springframework.core.Ordered; * *

Since Spring 4.1, the standard {@link javax.annotation.Priority} annotation * can be used as a drop-in replacement for this annotation in ordering scenarios. - * Note that {@code Priority} may have additional semantics when a single element + * Note that {@code @Priority} may have additional semantics when a single element * has to be picked (see {@link AnnotationAwareOrderComparator#getPriority}). * *

Alternatively, order values may also be determined on a per-instance basis diff --git a/src/docs/asciidoc/core/core-beans.adoc b/src/docs/asciidoc/core/core-beans.adoc index ac42c2c0053..0a1a7beb804 100644 --- a/src/docs/asciidoc/core/core-beans.adoc +++ b/src/docs/asciidoc/core/core-beans.adoc @@ -4438,17 +4438,17 @@ The same applies for typed collections: ==== Your target beans can implement the `org.springframework.core.Ordered` interface or use the `@Order` or standard `@Priority` annotation if you want items in the array or list -to be sorted into a specific order. Otherwise their order will follow the registration +to be sorted in a specific order. Otherwise their order will follow the registration order of the corresponding target bean definitions in the container. The `@Order` annotation may be declared at target class level but also on `@Bean` methods, potentially being very individual per bean definition (in case of multiple definitions -with the same bean class). `@Order` values may influence priorities at injection points +with the same bean class). `@Order` values may influence priorities at injection points, but please be aware that they do not influence singleton startup order which is an orthogonal concern determined by dependency relationships and `@DependsOn` declarations. Note that the standard `javax.annotation.Priority` annotation is not available at the -`@Bean` level since it cannot be declared on methods. Its semantics can be modelled +`@Bean` level since it cannot be declared on methods. Its semantics can be modeled through `@Order` values in combination with `@Primary` on a single bean per type. ====