Skip to content

AnnotationUtils does not support arbitrary levels of meta-annotations on methods [SPR-12941] #17534

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

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Apr 21, 2015

Sam Brannen opened SPR-12941 and commented

Status Quo

In contrast to the search algorithm used by the findAnnotation(Class, Class) method in AnnotationUtils, the findAnnotation(Method, Class) method currently only finds direct annotations or direct meta-annotations (i.e., one level of meta-annotations).

This lacking support for multiple levels of meta-annotations has been the cause of failing (though currently @Ignored) tests in TransactionalEventListenerTests since @EventListener is not discovered as a meta-meta-annotation by the EventListenerMethodProcessor.

Deliverables

  1. Rework findAnnotation(Method, Class) so that it supports arbitrary levels of meta-annotations on methods.

Issue Links:

Referenced from: commits b9b0b78

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented Apr 21, 2015

Sam Brannen commented

This is related to #17533.

@spring-projects-issues
Copy link
Collaborator Author

Sam Brannen commented

Fixed as described in GitHub commit b9b0b78:

Support n meta-annotation levels on methods in AnnotationUtils

Prior to this commit, the search algorithm used by the
findAnnotation(Method, Class) method in AnnotationUtils only found
direct annotations or direct meta-annotations (i.e., one level of
meta-annotations).

This commit reworks the search algorithm so that it supports arbitrary
levels of meta-annotations on methods. To make this possible, a new
findAnnotation(AnnotatedElement, Class) method has been introduced in
AnnotationUtils.

This fix also allows for the @Ignore'd tests in
TransactionalEventListenerTests to be re-enabled.

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: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants