-
Notifications
You must be signed in to change notification settings - Fork 38.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve warning for unexpected use of value attribute as @Component …
…name Prior to this commit, if a String 'value' attribute of an annotation was annotated with @AliasFor and explicitly configured to alias an attribute other than @Component.value, the value was still used as the @Component name, but the warning message that was logged stated that the 'value' attribute should be annotated with @AliasFor(annotation=Component.class). However, it is not possible to annotate an annotation attribute twice with @AliasFor. To address that, this commit revises the logic in AnnotationBeanNameGenerator so that it issues a log message similar to the following in such scenarios. WARN o.s.c.a.AnnotationBeanNameGenerator - Although the 'value' attribute in @example.MyStereotype declares @AliasFor for an attribute other than @Component's 'value' attribute, the value is still used as the @Component name based on convention. As of Spring Framework 7.0, such a 'value' attribute will no longer be used as the @Component name. See gh-34346 Closes gh-34317 (cherry picked from commit 17a94fb)
- Loading branch information
Showing
2 changed files
with
104 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters