mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-01 03:12:15 +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
275 B
Java
14 lines
275 B
Java
// "Replace with enhanced 'switch' statement" "true-preview"
|
|
|
|
class NotDefenitessignment1 {
|
|
void test(int x) {
|
|
String s;
|
|
if (Math.random() > 0.5) {
|
|
s = "bar";
|
|
}
|
|
switch (x) {
|
|
case 1 -> s = "baz";
|
|
case 2 -> s = "qux";
|
|
}
|
|
}
|
|
} |