RFR: 8361355: Negative cases of Annotated.getAnnotationData implementations are broken [v2]

Doug Simon dnsimon at openjdk.org
Thu Jul 3 14:13:23 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).

Doug Simon has refreshed the contents of this pull request, and previous commits have been removed. The incremental views will show differences compared to the previous content of the PR. The pull request contains one new commit since the last revision:

  fixed negative cases in getAnnotationData

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/26116/files
  - new: https://git.openjdk.org/jdk/pull/26116/files/86b41636..b25684f7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=26116&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=26116&range=00-01

  Stats: 11 lines in 1 file changed: 5 ins; 0 del; 6 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