Align ClassFileClassMetadata with other implementations#34869
Closed
philwebb wants to merge 2 commits intospring-projects:mainfrom
Closed
Align ClassFileClassMetadata with other implementations#34869philwebb wants to merge 2 commits intospring-projects:mainfrom
philwebb wants to merge 2 commits intospring-projects:mainfrom
Conversation
Update `ClassFileClassMetadata` to align the behavior of `getSuperClassName()` with other readers in that it returns `null` for `package-info` classes.
Update `ClassFileClassMetadata` so that member classes only include immediate children. This aligns with the other `ClassMetadata` implementations.
Member
Author
|
I found another quirk with member classes so I've added a second commit to this PR. |
bclozel
pushed a commit
that referenced
this pull request
May 9, 2025
Update `ClassFileClassMetadata` to align the behavior of `getSuperClassName()` with other readers in that it returns `null` for `package-info` classes. See gh-34869
Member
|
Thanks @philwebb ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return null for getSuperClassName() with package-info classes:
Upgrading Spring Boot to use Framework 7 hit an issue with
spring-hateoasand AOT hints.This is ultimately caused by a change in behavior when running on Java 24. With earlier versions, the
registerTypesForReflectionuses a scanner that uses aSimpleAnnotationMetadataReader. This scanner always returnsnullforgetSuperClassName()results frompackage-infoclasses. It appears thatClassFileClassMetadatareturnsObject.class.This seems like a possible bug in the new class file Java API, but I think we should add a workaround in our code as well.