Skip to content

Stop using explicitly aliased value attribute as @Component name #34346

Closed
@sbrannen

Description

@sbrannen

Overview

As discussed in #34317, if a custom annotation is meta-annotated with @Component and declares a local String value attribute that is explicitly configured (via @AliasFor) as an override for an attribute other than Component.value, the local value attribute is still used as a convention-based override for Component.value.

The result is that a local value attribute will be used as a custom @Component name, even when that is clearly not the intent.

In light of that, we will stop using a value attribute that is explicitly aliased to something other than @Component.value as the @Component name, beginning with Spring Framework 7.0.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions