Browse Source
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-36451pull/36469/head
2 changed files with 19 additions and 4 deletions
Loading…
Reference in new issue