mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-16 22:51:17 +07:00
12 lines
257 B
Java
12 lines
257 B
Java
// "Make 'x' effectively final by moving initializer to the 'if' statement" "true-preview"
|
|
class X {
|
|
void test(boolean a, int y) {
|
|
int x;
|
|
if (a) {
|
|
x = 1;
|
|
} else {
|
|
x = y;
|
|
}
|
|
Runnable r = () -> System.out.println(x);
|
|
}
|
|
} |