Suppose we have a switch case:
switch (someInt) {
case 1:
String data = getSomeString();
doThingOneWith(data);
break;
case 2:
data = getSomeOtherString();
doThingTwoWith(data);
break;
}
That will currently be rewritten by MinimumSwitchCases to
if (someInt == 1) {
String data = getSomeString();
doThingOneWith(data);
} else if (someInt == 2) {
data = getSomeOtherString();
doThingTwoWith(data);
}
which does not compile due to data not being declared in the else block's scope.