mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
17a94fb110
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