mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
lambda: do not suggest to replace with lambda when refs to final fields exist in body (IDEA-111026); final initializer
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
class MyTest {
|
||||
final Runnable lambdaRunnable = () -> {
|
||||
System.out.println(<error descr="Variable 'o' might not have been initialized">o</error>);
|
||||
};
|
||||
|
||||
final Object o;
|
||||
|
||||
MyTest(Object o) {
|
||||
this.o = o;
|
||||
}
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with lambda" "false"
|
||||
class MyTest {
|
||||
final Runnable anonymRunnable = new Run<caret>nable() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(o);
|
||||
}
|
||||
};
|
||||
|
||||
final Object o;
|
||||
|
||||
MyTest(Object o) {
|
||||
this.o = o;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user