mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
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
12 lines
262 B
Java
12 lines
262 B
Java
// "Replace 'switch' with 'if'" "true"
|
|
class X {
|
|
void m(String s) {
|
|
if ("foo".equals(s)) {
|
|
System.out.println(1);
|
|
} else if ("bar".equals(s)) {
|
|
System.out.println(3);
|
|
} else {
|
|
System.out.println(2);
|
|
}
|
|
}
|
|
} |