mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-27 04:08:01 +07:00
d9193529e2
GitOrigin-RevId: e6f1c6e2d80af6332bae642391ca4b6113aa12ed
18 lines
362 B
Java
18 lines
362 B
Java
// "Make 'x' effectively final by moving initializer to the 'if' statement" "true-preview"
|
|
class X {
|
|
void test(boolean a, boolean b, boolean c) {
|
|
int x;
|
|
if (a) {
|
|
if (b) {
|
|
x = 1;
|
|
} else {
|
|
x = 0;
|
|
}
|
|
} else if (c) {
|
|
x = 3;
|
|
} else {
|
|
x = 0;
|
|
}
|
|
Runnable r = () -> System.out.println(x);
|
|
}
|
|
} |