RFR: 8304671: javac regression: Compilation with --release 8 fails on underscore in enum identifiers

Jan Lahoda jlahoda at openjdk.org
Wed Mar 22 12:52:43 UTC 2023


`_` is a valid name for `--release 8`, but code that estimates if a piece of code is an enum constant or a member will fail to recognize that. This patch enhances the estimator to include `_` at the same level as identifiers.

For the estimator, it is not important if `_` is permitted for the given source level or not - the upper levels will produce proper errors/warnings. So, the estimator will consider `_` to be at the same level as an ordinary identifier.

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

Commit messages:
 - 8304671: javac regression: Compilation with --release 8 fails on underscore in enum identifiers

Changes: https://git.openjdk.org/jdk/pull/13137/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=13137&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8304671
  Stats: 190 lines in 2 files changed: 181 ins; 2 del; 7 mod
  Patch: https://git.openjdk.org/jdk/pull/13137.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/13137/head:pull/13137

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


More information about the compiler-dev mailing list