mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
anonym -> lambda: check initializer inside constructor for final fields (IDEA-120698)
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// "Replace with lambda" "true"
|
||||
class HelloLambda {
|
||||
final int x;
|
||||
|
||||
HelloLambda() {
|
||||
x = 1;
|
||||
Runnable r = () -> {
|
||||
System.out.println(x);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with lambda" "false"
|
||||
class HelloLambda {
|
||||
final int x;
|
||||
|
||||
HelloLambda() {
|
||||
Runnable r = new Runn<caret>able() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(x);
|
||||
|
||||
}
|
||||
};
|
||||
x = 1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
// "Replace with lambda" "true"
|
||||
class HelloLambda {
|
||||
final int x;
|
||||
|
||||
HelloLambda() {
|
||||
x = 1;
|
||||
Runnable r = new Runn<caret>able() {
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println(x);
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user