Skip to content
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

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

Closed
spring-issuemaster opened this issue Apr 21, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

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:

  • #17533 Document meta-annotation support in AnnotationUtils
  • #17300 AnnotatedElementUtils does not find annotations on methods in dynamic proxies

Referenced from: commits b9b0b78

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 21, 2015

Sam Brannen commented

This is related to #17533.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 21, 2015

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
You can’t perform that action at this time.