RFR: 8345248: Module name 'transitive' not accepted for `requires transitive`

Jan Lahoda jlahoda at openjdk.org
Fri Nov 29 14:21:10 UTC 2024


Considering module named `transitive`, it should be possible to write: `requires transitive;`, which works, and also `requires transitive transitive;`, which currently does not work:

$ javac -d out/ --module-source-path . transitive/module-info.java test/module-info.java
test/module-info.java:2: error: repeated modifier
    requires transitive transitive;
                        ^
test/module-info.java:2: error: <identifier> expected
    requires transitive transitive;
                                  ^
2 errors


The proposed solution is to properly handle lookahead if the transitive flag has already been seen.

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

Commit messages:
 - 8345248: Module name 'transitive' not accepted for `requires transitive`

Changes: https://git.openjdk.org/jdk/pull/22460/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=22460&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8345248
  Stats: 110 lines in 2 files changed: 106 ins; 3 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/22460.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/22460/head:pull/22460

PR: https://git.openjdk.org/jdk/pull/22460


More information about the compiler-dev mailing list