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

javac accepts sealed annotations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 16
    • 15, 16
    • tools
    • 15

      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

            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: