RFR: 8295401: Error recovery in module-info.java could be improved

Jan Lahoda jlahoda at openjdk.org
Mon Oct 17 14:44:25 UTC 2022


Consider an erroneous `module-info.java` like:

module m {
    provides javax.util.;
}


When javac parses this code, the resulting AST will not contain the (incomplete) directive for provides. This is different from the other directives, which are included, and complicates developing features, like code completion, over the AST.

The proposal is to simply include the incomplete provides directive in the list of directives.

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

Commit messages:
 - 8295401: Error recovery in module-info.java could be improved

Changes: https://git.openjdk.org/jdk/pull/10728/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=10728&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8295401
  Stats: 83 lines in 2 files changed: 77 ins; 2 del; 4 mod
  Patch: https://git.openjdk.org/jdk/pull/10728.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10728/head:pull/10728

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


More information about the compiler-dev mailing list