diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java index f8b7f20aa28..13407873bf1 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotatedElementUtils.java @@ -36,13 +36,13 @@ import org.springframework.util.MultiValueMap; * repeatable annotations on {@link AnnotatedElement AnnotatedElements}. * *

{@code AnnotatedElementUtils} defines the public API for Spring's - * meta-annotation programming model with support for annotation attribute - * overrides and {@link AliasFor @AliasFor}. Note, however, that - * {@code AnnotatedElementUtils} is effectively a facade for the - * {@link MergedAnnotations} API. For fine-grained support consider using the + * meta-annotation programming model with support for attribute aliases and + * annotation attribute overrides configured via {@link AliasFor @AliasFor}. + * Note, however, that {@code AnnotatedElementUtils} is effectively a facade for + * the {@link MergedAnnotations} API. For fine-grained support consider using the * {@code MergedAnnotations} API directly. If you do not need support for - * annotation attribute overrides, {@code @AliasFor}, or merged annotations, - * consider using {@link AnnotationUtils} instead. + * {@code @AliasFor} or merged annotations, consider using {@link AnnotationUtils} + * instead. * *

Note that the features of this class are not provided by the JDK's * introspection facilities themselves. @@ -286,9 +286,8 @@ public abstract class AnnotatedElementUtils { * the annotation hierarchy above the supplied {@code element} and * merge that annotation's attributes with matching attributes from * annotations in lower levels of the annotation hierarchy. - *

Attributes from lower levels in the annotation hierarchy override attributes - * of the same name from higher levels, and {@link AliasFor @AliasFor} semantics are - * fully supported, both within a single annotation and within the annotation hierarchy. + *

{@link AliasFor @AliasFor} semantics are fully supported, both within + * a single annotation and within the annotation hierarchy. *

In contrast to {@link #getAllAnnotationAttributes}, the search algorithm used by * this method will stop searching the annotation hierarchy once the first annotation * of the specified {@code annotationName} has been found. As a consequence, @@ -550,10 +549,8 @@ public abstract class AnnotatedElementUtils { * the annotation hierarchy above the supplied {@code element} and * merge that annotation's attributes with matching attributes from * annotations in lower levels of the annotation hierarchy. - *

Attributes from lower levels in the annotation hierarchy override - * attributes of the same name from higher levels, and - * {@link AliasFor @AliasFor} semantics are fully supported, both - * within a single annotation and within the annotation hierarchy. + *

{@link AliasFor @AliasFor} semantics are fully supported, both within + * a single annotation and within the annotation hierarchy. *

In contrast to {@link #getAllAnnotationAttributes}, the search algorithm * used by this method will stop searching the annotation hierarchy once the * first annotation of the specified {@code annotationType} has been found. @@ -585,10 +582,8 @@ public abstract class AnnotatedElementUtils { * the annotation hierarchy above the supplied {@code element} and * merge that annotation's attributes with matching attributes from * annotations in lower levels of the annotation hierarchy. - *

Attributes from lower levels in the annotation hierarchy override - * attributes of the same name from higher levels, and - * {@link AliasFor @AliasFor} semantics are fully supported, both - * within a single annotation and within the annotation hierarchy. + *

{@link AliasFor @AliasFor} semantics are fully supported, both within + * a single annotation and within the annotation hierarchy. *

In contrast to {@link #getAllAnnotationAttributes}, the search * algorithm used by this method will stop searching the annotation * hierarchy once the first annotation of the specified diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java index de9b411673e..7a9b18287b2 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMapping.java @@ -415,8 +415,8 @@ final class AnnotationTypeMapping { * Get a mapped attribute value from the most suitable * {@link #getAnnotation() meta-annotation}. *

The resulting value is obtained from the closest meta-annotation, - * taking into consideration both convention and alias based mapping rules. - * For root mappings, this method will always return {@code null}. + * taking into consideration alias based mapping rules. For root mappings, + * this method will always return {@code null}. * @param attributeIndex the attribute index of the source attribute * @param metaAnnotationsOnly if only meta annotations should be considered. * If this parameter is {@code false} then aliases within the annotation will diff --git a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java index b57a4a27072..e488aeddd92 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/AnnotationTypeMappings.java @@ -36,9 +36,9 @@ import org.springframework.util.ConcurrentReferenceHashMap; * meta-annotations to ultimately provide a quick way to map the attributes of * a root {@link Annotation}. * - *

Supports convention based merging of meta-annotations as well as implicit - * and explicit {@link AliasFor @AliasFor} aliases. Also provides information - * about mirrored attributes. + *

Supports merging of meta-annotations as well as implicit and explicit + * {@link AliasFor @AliasFor} aliases. Also provides information about mirrored + * attributes. * *

This class is designed to be cached so that meta-annotations only need to * be searched once, regardless of how many times they are actually used. diff --git a/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotation.java b/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotation.java index f67befc9d3c..bdabde5be41 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotation.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotation.java @@ -490,8 +490,6 @@ public interface MergedAnnotation { * it has not already been synthesized and one of the following is true. *

diff --git a/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java b/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java index 3bbbb403683..2267b0f829b 100644 --- a/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java +++ b/spring-core/src/main/java/org/springframework/core/annotation/MergedAnnotations.java @@ -39,7 +39,6 @@ import org.springframework.util.Assert; *
  • Explicit and implicit {@link AliasFor @AliasFor} declarations on one or * more attributes within the annotation
  • *
  • Explicit {@code @AliasFor} declarations for a meta-annotation
  • - *
  • Convention based attribute aliases for a meta-annotation
  • *
  • From a meta-annotation declaration
  • * * diff --git a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java index afc12936a42..bac3c96eb09 100644 --- a/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java +++ b/spring-core/src/test/java/org/springframework/core/annotation/AnnotationUtilsTests.java @@ -1356,7 +1356,9 @@ class AnnotationUtilsTests { /** * Mock of {@code org.springframework.web.bind.annotation.PostMapping}, except - * that the path is overridden by convention with single String element. + * that the path is intended to be overridden by convention with single String + * element. However, convention-based annotation attribute overrides are no + * longer supported as of Spring Framework 7.0. */ @Retention(RetentionPolicy.RUNTIME) @WebMapping(method = RequestMethod.POST, name = "")