Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convertSwitchToIf/beforeDeclareNoOuterBlock.java
Tagir Valeev 625c1cc676 ConvertSwitchToIfIntention: fixes after review IDEA-CR-37311:
1. Do not suggest intention if `default` case is not the last one and fallthrough is possible into or out of that case
2. Generate a code-block if side-effect should be extracted to variable
2018-09-27 10:17:10 +07:00

12 lines
220 B
Java

// "Replace 'switch' with 'if'" "true"
class X {
int m(int i) {
if (i > 0)
sw<caret>itch (++i) {
case 1:
System.out.println(1);
case 2:
System.out.println(2);
}
}
}