Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/convertSwitchToIf/beforeBreakWithLabel.java
Tagir Valeev f859a4c439 Support BreakConverter in ConvertSwitchToIfIntention
Fixes IDEA-141261 'Replace 'switch' with 'if'' intention produces incorrect code if some 'case' clause contains 'break' statement inside 'if'
2018-09-26 11:58:20 +07:00

22 lines
433 B
Java

// "Replace 'switch' with 'if'" "true"
class X {
int m(String s, int x) {
if (x > 0) {
SWITCH:
swi<caret>tch (s){
case "a":
System.out.println("a");
for(int i=0; i<10; i++) {
System.out.println(i);
if(i == x) break SWITCH;
if(i == x*2) break;
}
default:
System.out.println("d");
}
} else {
return 1;
}
return 0;
}
}