mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-07 13:39:36 +07:00
ensure non-initialized fields used inside lambdas are rejected if lambda is inside class initializer only (IDEA-154305)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
class Test {
|
||||
|
||||
protected final String init;
|
||||
protected final Runnable foo = new Runnable() {
|
||||
{
|
||||
Runnable r = () -> {
|
||||
new Runnable() {
|
||||
{
|
||||
System.out.println(<error descr="Variable 'init' might not have been initialized">init</error>);
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
};
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
public Test(String init) {
|
||||
this.init = init;
|
||||
}
|
||||
|
||||
private void createClass() {
|
||||
new Thread() {
|
||||
{
|
||||
Runnable runnable1 = () -> System.out.println(init);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user