RFR: 8297118: Change IncompatibleClassChangeError to MatchException for exhaustive switch statements and switch expressions

Jan Lahoda jlahoda at openjdk.org
Wed Nov 16 15:19:23 UTC 2022


As per recent update of the JEP 433 specification, javac should use MatchException instead of IncompatbileClassChangeError to flag switches over enum values that were exhaustive at compile time, but no longer are exhaustive at runtime. This patch implements that change.

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

Depends on: https://git.openjdk.org/jdk/pull/10814

Commit messages:
 - Using pattern switch instead of record patterns as the feature key to determine whether MatchException should be used instead of ICCE.
 - 8297118: Change IncompatibleClassChangeError to MatchException for exhaustive switch statements and switch expressions

Changes: https://git.openjdk.org/jdk/pull/11189/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11189&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8297118
  Stats: 226 lines in 4 files changed: 220 ins; 1 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/11189.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11189/head:pull/11189

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


More information about the compiler-dev mailing list