javac misalignment with the JLS

Gavin Bierman gavin.bierman at oracle.com
Mon Jun 10 08:43:19 UTC 2024


Hi Emilia,

Thanks. Could you file this as a bug and I’ll attend to it?

Cheers,
Gavin

On 9 Jun 2024, at 00:16, Emilia López <emilia.lopezf.1999 at gmail.com> wrote:

Hi,

Upon reading the JLS, chapter §7.7.1 Module Declaration - Dependences [1], the spec does not mention anything regarding multiple appearances of the requires modifiers (transitive and static), however javac errs if static is declared multiple times, and if transitive is declared twice or more consecutively, the second time the token is consumed as a module name, despite the BNF indicating any amount of {RequiresModifier} instances; the English description is lacking. Is the Java language specification wrong, lacking or missing in describing this aspect of compilation of modular compilation units? Or does javac not abide by it?

[1] https://docs.oracle.com/javase/specs/jls/se22/html/jls-7.html#jls-7.7.1

Regards,
Emilia López

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/compiler-dev/attachments/20240610/220aac87/attachment.htm>


More information about the compiler-dev mailing list