On Fri, 29 Mar 2024 01:17:42 GMT, Vicente Romero <vrom...@openjdk.org> wrote:

> Please review this simple fix, basically javadoc is showing the `sealed` 
> modifier for methods annotated with the `jdk.internal.javac.Restricted` 
> annotation. This is because the `SEALED` and `RESTRICTED` flags share the 
> same bit. The proposed solution is to drop the `RESTRICTED` flag at 
> MethodSymbol::getModifiers before converting the flags to modifiers,
> 
> TIA,
> Vicente

src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java line 1999:

> 1997:             // just in case the method is restricted but that is not a 
> modifier
> 1998:             long flags = flags() & ~RESTRICTED;
> 1999:             return Flags.asModifierSet((flags & DEFAULT) != 0 ? flags & 
> ~ABSTRACT : flags);

Maybe `Flags::asModifierSet` could be extended in another PR to take a 
parameter for the different modifier kinds, which would then be used to 
disambiguate overloaded `Flags` bits.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18543#discussion_r1547464269

Reply via email to