RFR: 8311825: Duplicate qualified enum constants not detected

Jan Lahoda jlahoda at openjdk.org
Thu Jul 13 12:59:16 UTC 2023


Duplicate enum constant check is missing for switches, when the qualified constants are used, so code like:

switch (...) {
     case E.A -> {}
     case E.A -> {}
}


Does not produce any errors. This patch is trying to fix this problem by adding the duplicate checks (sadly the codepaths are distinct, so the check is simply added to the various codepaths).

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

Commit messages:
 - 8311825: Duplicate qualified enum constants not detected

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

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


More information about the compiler-dev mailing list