mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
cc5c7ba186
Prior to this commit, the `ClassFile` based implementation of `AnnotationMetadata` would rely on the `NestHost` class element to get the enclosing class name for a nested class. This approach works for bytecode emitted by Java11+, which aligns with our Java17+ runtime policy. But there are cases where bytecode was not emitted by a Java11+ compiler, such as Kotlin. In this case, the `NestHost` class element is absent and we should instead use the `InnerClasses` information to get it. This commit makes use of `InnerClasses` to get the enclosing class name, but still uses `NestHost` as a fallback for anonymous classes. Fixes gh-36451