mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-06 08:00:18 +07:00
- not call twice if variable is initialized with method calls - use references to variable in default branch only if it is definite assignment GitOrigin-RevId: bfe7af32d011c4ec275930770578527f23770057
14 lines
264 B
Java
14 lines
264 B
Java
// "Replace with 'switch' expression" "false"
|
|
|
|
class NotDefenitelyAssignment1 {
|
|
void test(int x) {
|
|
String s;
|
|
if (Math.random() > 0.5) {
|
|
s = "bar";
|
|
}
|
|
swi<caret>tch (x) {
|
|
case 1:s = "baz";break;
|
|
case 2:s = "qux";break;
|
|
}
|
|
}
|
|
} |