RFR: 8361355: Negative cases of Annotated.getAnnotationData implementations are broken
Doug Simon
dnsimon at openjdk.org
Thu Jul 3 13:04:19 UTC 2025
This PR fixes bugs in the implementation of `jdk.vm.ci.meta.Annotated.getAnnotationData`:
1. Calling `getAnnotatedData(annotationType)` fails with an ArrayIndexOutOfBoundsException instead of returning null when the receiver type is not annotated by `annotationType`.
2. Calling either of the `getAnnotatedData` methods with an `annotationType` value that does not represent an annotation interface silently succeeds when the receiver type does not (or can not) have any annotations (e.g. array and primitive types).
-------------
Commit messages:
- fixed negative cases in getAnnotationData
Changes: https://git.openjdk.org/jdk/pull/26116/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26116&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8361355
Stats: 100 lines in 7 files changed: 89 ins; 1 del; 10 mod
Patch: https://git.openjdk.org/jdk/pull/26116.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/26116/head:pull/26116
PR: https://git.openjdk.org/jdk/pull/26116
More information about the graal-dev
mailing list