Commit Graph

3 Commits

Author SHA1 Message Date
Andrey Cherkasov
48c32d8c10 [java-highlighting] Cannot resolve symbol: false negative in 'switch' statements and expressions
IDEA-311341

GitOrigin-RevId: f3010ae23ade75f3a6ab4dcf31ae27b9c539f3f1
2023-01-26 10:14:57 +00:00
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