Having two cases in the same switch statement with the same implementation is at best duplicate code, and at worst a coding error. If the same logic is truly needed for both cases, then one should fall through to the other.
switch (i) {
case 1:
doSomething();
break;
case 2:
doSomethingDifferent();
break;
case 3: // Noncompliant; duplicates case 1's implementation
doSomething();
break;
}
switch (i) {
case 1:
case 3:
doSomething();
break;
case 2:
doSomethingDifferent();
break;
}
or
switch (i) {
case 1:
doSomething();
break;
case 2:Check
doSomethingDifferent();
break;
case 3:
doThirdThing();
break;
}