Skip to content

Document that @DefaultValue can be used on a record component #30460

Description

@wilkinsona

With thanks to @danvega for bringing this to our attention, we made a mistake in #29010.

An annotation can be used on a record component if it targets one or more of FIELD, METHOD, PARAMETER, and RECORD_COMPONENT. The annotation is then propagated to the record component's field, accessor method, constructor parameter, or the record component itself based on these targets. @DefaultValue already has a target of PARAMETER so prior to the changes in #29010 it could be used on a record component and would then be propagated to the record's constructor. From there it would be found by configuration property binding and the annotation processor.

We can update the documentation and backport some tests in 2.5 as things already work there without any changes to main code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions