MethodSymbol.getModifiers() returns SEALED for restricted methods

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 23
    • Affects Version/s: 22
    • Component/s: 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).

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

              Created:
              Updated:
              Resolved: