Skip to content

@AliasFor attribute name should default to declaring attribute [SPR-13828] #18401

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
spring-projects-issues opened this issue Dec 29, 2015 · 2 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 29, 2015

Juergen Hoeller opened SPR-13828 and commented

@AliasFor currently insists on the attribute name to be specified, through either attribute or value. For references to same-named attributes on meta-annotations, the attribute name could easily default to the declaring attribute. A typical use case is creating custom @Value annotations with a mirrored value attribute (#18181).


Affects: 4.2.4

Issue Links:

Referenced from: commits 3242ad8

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As a consequence, we throw an exception in case of a reference to the same attribute now, suggesting to point either to a specific meta-annotation or to a different attribute name. The default attribute name is the declaring attribute now but the exception will be thrown in case of an explicit reference to the same attribute on the same annotation as well.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

That's a nice convention to support.

Thanks, Juergen Hoeller! (y)

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
Projects
None yet
Development

No branches or pull requests

2 participants