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 won't find javax annotations [SPR-17495] #22027

spring-issuemaster opened this issue Nov 14, 2018 · 1 comment


Copy link

@spring-issuemaster spring-issuemaster commented Nov 14, 2018

Phil Webb opened SPR-17495 and commented

Given a class Foo annotated with javax.transaction.Transactional calling:

AnnotatedElementUtils.getMergedAnnotation(Foo.class, javax.interceptor.InterceptorBinding.class)

Will result in null despite the fact that Transactional is meta-annotated with InterceptorBinding.

The root cause appears to be AnnotationUtils.hasPlainJavaAnnotationsOnly which does name.startsWith("java") and perhaps should do name.startsWith("java.").

return (name.startsWith("java") || name.startsWith("org.springframework.lang."));

Reference URL: spring-projects/spring-boot#15175

Referenced from: commits spring-projects/spring-boot@79b5dd3


This comment has been minimized.

Copy link

@philwebb philwebb commented Mar 11, 2019

Not loading javax types appears to be intentional and changing the logic is likely to degrade performance. Since we've added a guard in the Spring Boot code, I think we should close this one for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.