RFR: 8320144: Compilation crashes when a custom annotation with invalid default value is used

Aggelos Biboudis abimpoudis at openjdk.org
Tue Dec 5 16:40:51 UTC 2023


The erroneous case of:

`public String[] excludeModules() default new String[0];`

was not short-circuited in the compiler and we were getting an NPE in `l.nonEmpty()` for `l`. Now, `getAnnotationArrayValue` returns the error attribute, if that case is detected.

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

Commit messages:
 - 8320144: Compilation crashes when a custom annotation with invalid default value is used

Changes: https://git.openjdk.org/jdk/pull/16977/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16977&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8320144
  Stats: 41 lines in 3 files changed: 31 ins; 10 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/16977.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16977/head:pull/16977

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


More information about the compiler-dev mailing list