RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v6]

Vicente Romero vromero at openjdk.org
Mon Apr 24 18:09:02 UTC 2023


On Mon, 24 Apr 2023 15:16:18 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:

>> This is the first draft of a patch for JEP 440 and JEP 441. Changes included:
>> 
>>  - the pattern matching for switch and record patterns features are made final, together with updates to tests.
>>  - parenthesized patterns are removed.
>>  - qualified enum constants are supported for case labels.
>> 
>> This change herein also includes removal record patterns in for each loop, which may be split into a separate PR in the future.
>
> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Reflecting review changes.

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 3212:

> 3210:         @Override
> 3211:         public void visitCase(JCCase tree) {
> 3212:             super.visitCase(tree); // Generated from nbfs://nbhost/SystemFileSystem/Templates/Classes/Code/OverriddenMethodBody

do we need this comment?

src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TransPatterns.java line 862:

> 860: 
> 861:     private LoadableConstant createEnumDesc(DiagnosticPosition pos, ClassSymbol enumClass, Name constant) {
> 862:         //ConstantBootstrap.invoke(..., EnumDesc.of(ConstantBootstrap.invoke(..., ClassDesc.of(enumClass)), constant))

I think this comment can be removed or probably reformatted

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

PR Review Comment: https://git.openjdk.org/jdk/pull/13074#discussion_r1175611723
PR Review Comment: https://git.openjdk.org/jdk/pull/13074#discussion_r1175615234


More information about the core-libs-dev mailing list