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

Closed
spring-projects-issues opened this issue Nov 14, 2018 · 1 comment
Closed

AnnotationUtils won't find javax annotations [SPR-17495] #22027

spring-projects-issues opened this issue Nov 14, 2018 · 1 comment
Labels
status: declined

Comments

@spring-projects-issues
Copy link
Collaborator

@spring-projects-issues spring-projects-issues 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

@spring-projects-issues spring-projects-issues added status: waiting-for-triage type: enhancement in: core and removed type: enhancement labels Jan 11, 2019
@philwebb
Copy link
Member

@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.

@philwebb philwebb added status: declined and removed in: core status: waiting-for-triage labels Mar 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: declined
Projects
None yet
Development

No branches or pull requests

2 participants