[lworld] RFR: 8292630: [lworld] javac is accepting annotation interface declarations with modifiers: identity and value

Vicente Romero vromero at openjdk.org
Mon Aug 22 18:03:28 UTC 2022


Please review this fix which is syncing the compiler implementation with the spec. The current spec [1] mentions that:

   * It is a compile-time error if an annotation interface declaration has the modifier sealed, or non-sealed, identity, or value (9.1.1.4).

So code code like:

value @interface I {} and
identity @interface I {}


should be rejected by the compiler.

 [1] http://cr.openjdk.java.net/~dlsmith/jep8277163/jep8277163-20220519/specs/value-objects-jls.html

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

Commit messages:
 - 8292630: [lworld] javac is accepting annotation interface declarations with modifiers: identity and value

Changes: https://git.openjdk.org/valhalla/pull/723/files
 Webrev: https://webrevs.openjdk.org/?repo=valhalla&pr=723&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8292630
  Stats: 24 lines in 4 files changed: 22 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/valhalla/pull/723.diff
  Fetch: git fetch https://git.openjdk.org/valhalla pull/723/head:pull/723

PR: https://git.openjdk.org/valhalla/pull/723


More information about the valhalla-dev mailing list