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

Eliminate java.lang annotations from AnnotatedTypeMetadata #22885

Closed
philwebb opened this issue May 4, 2019 · 1 comment
Closed

Eliminate java.lang annotations from AnnotatedTypeMetadata #22885

philwebb opened this issue May 4, 2019 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task

Comments

@philwebb
Copy link
Member

philwebb commented May 4, 2019

Currently AnnotatedTypeMetadata has some fairly inconsistent rules around java.lang annotations.

With StandardAnnotationMetadata for example hasAnnotation will support java.lang annotations, where as isAnnotated delegates AnnotatedElementUtils which will filter them.

The ASM AnnotationMetadataReadingVisitor class provides parity by using AnnotationUtils.isInJavaLangAnnotationPackage(annotationName) for isAnnotated.

Some work on removing the overhead of java.lang processing was implemented in #17580 but I think we can go further and simply always filter java.lang annotations. Doing this will also help simplify the implementation for #22884

@philwebb philwebb added the type: task A general task label May 4, 2019
@philwebb philwebb self-assigned this May 4, 2019
philwebb added a commit to philwebb/spring-framework that referenced this issue May 4, 2019
Update `StandardAnnotationMetadata` and `AnnotationMetadataReadingVisitor`
so that `java.lang.annotation` annotations are consistently skipped.

Closes spring-projectsgh-22885
@philwebb
Copy link
Member Author

philwebb commented May 4, 2019

I have a branch at https://github.com/philwebb/spring-framework/tree/gh-22885 that passes locally and with a full Spring Boot build. I'll probably roll this into a single PR for the #22884 work.

@jhoeller jhoeller added the in: core Issues in core modules (aop, beans, core, context, expression) label May 4, 2019
philwebb added a commit to philwebb/spring-framework that referenced this issue May 6, 2019
Update `StandardAnnotationMetadata` and `AnnotationMetadataReadingVisitor`
so that `java.lang.annotation` annotations are consistently skipped.

Closes spring-projectsgh-22885
philwebb added a commit to philwebb/spring-framework that referenced this issue May 6, 2019
Update `StandardAnnotationMetadata` and `AnnotationMetadataReadingVisitor`
so that `java.lang.annotation` annotations are consistently skipped.

Closes spring-projectsgh-22885
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: task A general task
Projects
None yet
Development

No branches or pull requests

2 participants