-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Deprecate convention-based annotation attribute overrides in favor of @AliasFor
#28760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
1 task done
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
Comments
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Jul 6, 2022
…st and spring-mvc See spring-projectsgh-28760
sbrannen
added a commit
that referenced
this issue
Jul 8, 2022
This commit replaces convention-based annotation attribute overrides in tests with explicit use of @AliasFor -- except for tests in spring-core, since we still want to test our support for convention-based annotation attribute overrides. See gh-28760
sbrannen
added a commit
to sbrannen/spring-framework
that referenced
this issue
Jul 9, 2022
The warning message logged for an annotation that still uses convention-based overrides now includes a concrete suggestion for how the problem may potentially be fixed. WARN - Support for convention-based annotation attribute overrides is deprecated and will be removed in Spring Framework 6.1. Please annotate the 'locations' attribute in @org.springframework.core.annotation.MergedAnnotationsTests$ConventionBasedComposedContextConfiguration with an appropriate @AliasFor declaration -- for example, @AliasFor(annotation = org.springframework.core.annotation.MergedAnnotationsTests$ContextConfiguration.class). See spring-projectsgh-28760
sbrannen
added a commit
that referenced
this issue
Oct 17, 2022
@AliasFor
2 tasks
sbrannen
added a commit
that referenced
this issue
Mar 6, 2025
This commit completely removes all support for convention-based annotation attribute overrides in Spring's annotation utilities and the MergedAnnotations infrastructure. Composed annotations must now use @AliasFor to declare explicit overrides for attributes in meta-annotations. See gh-28760 Closes gh-28761
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Overview
Implicit convention-based annotation attribute overrides have been supported for a long time; however, Spring Framework 4.2 introduced support for explicit annotation attribute overrides via
@AliasFor
.Since explicit overrides are favorable to implicit overrides, and since the support for convention-based overrides increases the complexity of Spring's annotation search algorithms, we will deprecate convention-based overrides in 6.0 and remove the support in 7.0 (see #28761).
Deliverables
The text was updated successfully, but these errors were encountered: