mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 02:38:59 +07:00
Fixes IDEA-374601 Copy 'x' to effectively final variable breaks code when type is non-denotable GitOrigin-RevId: 3b2d15f24b182ac3948ae3b5066c5e68c1c0bf5c
18 lines
329 B
Java
18 lines
329 B
Java
// "Copy 'x' to effectively final temp variable" "true-preview"
|
|
class Abc {
|
|
interface A{}
|
|
interface B{
|
|
void m();
|
|
}
|
|
|
|
void test(Object obj) {
|
|
var x = (A & B) obj;
|
|
if (Math.random() > 0.5) {
|
|
x = null;
|
|
}
|
|
var finalX = x;
|
|
Runnable r = () -> {
|
|
if (finalX != null) finalX.m();
|
|
};
|
|
}
|
|
} |