Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convertSwitchToIf/afterDeclareNoOuterBlock.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

15 lines
285 B
Java

// "Replace 'switch' with 'if'" "true"
class X {
int m(int i) {
if (i > 0) {
int i1 = ++i;
if (i1 == 1) {
System.out.println(1);
System.out.println(2);
} else if (i1 == 2) {
System.out.println(2);
}
}
}
}