Skip to content

AnnotationUtils fails to retrieve attribute values from non-public annotations [SPR-11104] #15730

Closed
@spring-projects-issues

Description

@spring-projects-issues

Sam Brannen opened SPR-11104 and commented

Status Quo

The getValue() methods in AnnotationUtils currently fail to retrieve the value of the desired annotation attribute if the annotation itself is not public (i.e., package private). In contrast, the getDefaultValue() methods work fine since they invoke Method#getDefaultValue(). Thus the problem lies with the fact that AnnotationUtils.getValue(Annotation, String) attempts to invoke the method, swallowing the exception on failure and silently returning null.

Deliverables

  1. Update AnnotationUtils.getValue(Annotation, String) so that it uses reflection to make the desired annotation attribute method accessible before invoking it to retrieve the value.

Affects: 3.0 GA

Issue Links:

Referenced from: commits b830d73

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions