Feature Overview
This feature converts switch-case
structure to nested if-else.
This feature converts switch-case
structure to nested if-else.
None
public class SwitchDemo {
public static void test() {
Integer i = 3;
switch(i) {
case 0:
System.debug('0');
break;
case 1:
case 2:
System.debug('other');
default:
return;
}
}
}
public class SwitchDemo {
public static void test() {
Integer i = 3;
Object SwitchDemo_test_s = i;
if(SwitchDemo_test_s == 0) {
System.debug('0');
} else {
if(SwitchDemo_test_s == 1) {
}
if(SwitchDemo_test_s == 2) {
System.debug('other');
}
return;
}
}
}
Contribute on Github! Edit this section.