Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8292630

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • repo-valhalla
    • repo-valhalla
    • tools

      This is not allowed by the current spec [1]:

          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

            vromero Vicente Arturo Romero Zaldivar
            vromero Vicente Arturo Romero Zaldivar
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: