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

MethodSymbol.getModifiers() returns SEALED for restricted methods

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 23
    • 22
    • tools
    • None
    • b17
    • generic
    • generic

      com.sun.tools.javac.code.Symbol$MethodSymbol includes `javax.lang.model.element.Modifier.SEALED` in the set returned by `getModifiers()` if the method is annotated with `jdk.internal.javac.Restricted`.

      The likely reason is that `RESTRICTED` and `SEALED` constants have the same value in `com.sun.tools.javac.code.Flags` and therefore need to be interpreted depending on the kind of symbol it is used on, which is not the case in above method.

      This causes JavaDoc to show the `sealed` modifier on restricted methods (see JDK-8325209).

            vromero Vicente Arturo Romero Zaldivar
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: