JEP proposed to target JDK 17: 406: Pattern Matching for switch (Preview)

Brian Goetz brian.goetz at oracle.com
Tue Jun 1 21:07:45 UTC 2021


> Is this a style issue or a legacy code issue? Given that sealed types 
> are being introduced with completeness, then it has to be a legacy 
> code issue. With jigsaw, warnings were introduced to identify 
> problematic code. These warnings later became errors.  I hope the same 
> treatment can be given to incomplete switches.

We hope that we can eventually upgrade these warnings to errors, after a 
sufficient period of notice.  But that could take a while. In the 
meantime, the language permits incomplete legacy statement switches.


More information about the jdk-dev mailing list