Commit Graph
2 Commits
Author SHA1 Message Date
Nikita Eshkeev ee954bc169 [java switch resolve] IDEA-277110 Compilation error not highlighted when using Pattern Matching for switch
Fallthrough to default is not acceptable according to JEP 406. This patch eliminates the default cases from a special case rules and leaves only `case null` as the only special case rule.

GitOrigin-RevId: 06c865f92fed01a41c5c87e1aa0a852acb3e7ee0
2021-08-31 20:52:55 +00:00
Nikita Eshkeev 127bc75ad2 [java][switch] IDEA-273959 Good code red: 'cannot resolve symbol' in preceding case label
Add the fix to properly handle situations when a case label is a special one ("case null", "case default", "default") but it's not a fallthrough one.

Move the methods that check if a statement can always execute its instructions from ControlFlowUtils to JavaControlFlowUtils in order to call them from PsiSwitchLabelStatementImpl

GitOrigin-RevId: 24c4aa3964be115b02fb499875fb97c89ea2ac08
2021-07-29 13:10:42 +00:00