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

javac accepts sealed annotations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 15, 16
    • Fix Version/s: 16
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • Introduced In Version:
      15

      Description

      the spec for sealed types [1] states:

      It is a compile-time error if an annotation type declaration has the modifier sealed. The compiler is currently accepting this code:

      public sealed @interface MyAnno {}

      non-sealed interface Foo extends MyAnno {}

      the compiler should be in sync with the spec.

      [1] http://cr.openjdk.java.net/~gbierman/jep360/jep360-20200526/specs/sealed-classes-jls.html#jls-9.6

      reported by Tagir at:
      https://mail.openjdk.java.net/pipermail/amber-dev/2020-August/006447.html

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: