RFR: 8335927: Revisit AnnotationConstantValueEntry and AnnotationValue.OfConstant

Chen Liang liach at openjdk.org
Sun Jul 14 22:36:17 UTC 2024


Remove `AnnotationConstantValueEntry` and `AnnotationValue.OfConstant`.

This is a relic of the old model from https://github.com/openjdk/jdk-sandbox/commit/bb7e29474ecfcfbd1eb01d237593eb80d062944f. In addition, this is bug-prone: the byte, short, char, and boolean constants use the int entry, and getting the `ConstantDesc` for them will return an `Integer`, which cannot be inversed back into the respective annotation values via `AnnotationValue.of(Object)` factory.

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

Commit messages:
 - Redundant since tags
 - Remove AnnotationValue.OfConstant
 - Merge branch 'master' of https://github.com/openjdk/jdk into fix/acve
 - Merge branch 'm3' into fix/acve
 - Remove AnnotationConstantValueEntry

Changes: https://git.openjdk.org/jdk/pull/20176/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20176&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8335927
  Stats: 391 lines in 19 files changed: 129 ins; 105 del; 157 mod
  Patch: https://git.openjdk.org/jdk/pull/20176.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20176/head:pull/20176

PR: https://git.openjdk.org/jdk/pull/20176


More information about the core-libs-dev mailing list