RFR: 8297118: Change IncompatibleClassChangeError to MatchException for exhaustive switch statements and switch expressions
Joe Darcy
darcy at openjdk.org
Thu Nov 17 00:57:57 UTC 2022
On Wed, 16 Nov 2022 15:11:32 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
> 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.
src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java line 131:
> 129: options.getBoolean("optimizeOuterThis", false);
> 130: disableProtectedAccessors = options.isSet("disableProtectedAccessors");
> 131: Source source = Source.instance(context);
Does this merit addition of a feature-enum constant in the usual way?
-------------
PR: https://git.openjdk.org/jdk/pull/11189
More information about the compiler-dev
mailing list