Skip to content

remove old asm & AnnotationMetadataReader supporting classes; adopt SimpleMetadataReaderFactory #14922

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

Open
wants to merge 1 commit into
base: 7.0.x
Choose a base branch
from

Conversation

jdaugherty
Copy link
Contributor

@jdaugherty jdaugherty commented Jul 17, 2025

From what I can tell, AnnotationMetadataReader was written for performance reasons. Since Spring 5.2, this was deprecated and finally removed in 6.x. We had copied the file from Spring to get Grails 7 working, but I'm not sure this was the right decision.

Searching the internet + using chatgpt, I noticed this document. Out of curiosity, I removed the AnnotationMetadataReader & replaced it with the upstream Spring reader. All of the tests pass.

I wanted to create this PR as a discussion point since:

  1. AnnotationMetadataReader doesn't support @Repeatable
  2. Spring acknowledged the performance issues via the rewrite
  3. The newer method is both thread safe & readonly - so we could technically cache it now
  4. To get spring native working they had to adopt this. I'm not sure we'll ever be able to run with graalvm, but taking steps to support this seems reasonable.
  5. This would also have the benefit of simplifying our NOTICE / LICENSE files since both the ASM library & code from Spring can be removed.

I'm going to leave this open for discussion in next week's weekly dev meeting.

Copy link
Contributor

@jamesfredley jamesfredley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good replacement for the changes made in 3.1.x and 7.0.x:

679acbe

a6dd1ec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants