Skip to content

AnnotatedElementUtils does not find annotations on methods in dynamic proxies [SPR-12703] #17300

Closed
@spring-projects-issues

Description

@spring-projects-issues

Stéphane Nicoll opened SPR-12703 and commented

The following two calls do not yield consistent results when the method is a method of a dynamic proxy.

AnnotatedElementUtils.getAnnotationAttributes(this.method, FooBar.class.getName());

The above returns null; whereas, the following call on the same method returns the FooBar annotation instance.

AnnotationUtils.findAnnotation(this.method, FooBar.class)

The code merged for #16696 has some TODOs in ApplicationListenerMethodAdapter and tests that expose this behavior (removing the call to AnnotationUtils will fail with a NullPointerException).


Affects: 4.1 GA

Issue Links:

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: duplicateA duplicate of another issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions