Skip to content

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

Closed

Description

@spring-projects-issues

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

Activity

  1. spring-projects-issues commented on Dec 29, 2015

    @spring-projects-issues
    CollaboratorAuthor

    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.

  2. spring-projects-issues commented on Dec 29, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Sam Brannen commented

    That's a nice convention to support.

    Thanks, Juergen Hoeller! (y)

  3. added
    type: enhancement
    in: core
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: coretype: enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions