mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
IDEA-112552 "Replace with lambda" should use expression lambda when possible
This commit is contained in:
+1
-3
@@ -7,9 +7,7 @@ class Test {
|
||||
|
||||
interface InOutEx extends InOut {
|
||||
InOut bind() {
|
||||
return () -> {
|
||||
foo();
|
||||
};
|
||||
return () -> foo();
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -6,8 +6,6 @@ class Test {
|
||||
}
|
||||
|
||||
InOut bind() {
|
||||
return () -> {
|
||||
InOut.foo();
|
||||
};
|
||||
return () -> InOut.foo();
|
||||
}
|
||||
}
|
||||
+1
-4
@@ -4,10 +4,7 @@ class HelloLambda {
|
||||
|
||||
HelloLambda() {
|
||||
x = 1;
|
||||
Runnable r = () -> {
|
||||
System.out.println(x);
|
||||
|
||||
};
|
||||
Runnable r = () -> System.out.println(x);
|
||||
|
||||
}
|
||||
|
||||
|
||||
+1
-3
@@ -1,7 +1,5 @@
|
||||
// "Replace with lambda" "true"
|
||||
class HelloLambda {
|
||||
private final Runnable r = () -> {
|
||||
System.out.println(x);
|
||||
};
|
||||
private final Runnable r = () -> System.out.println(x);
|
||||
private static int x = 0;
|
||||
}
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
{
|
||||
Runnable r = () -> {
|
||||
System.out.println("");
|
||||
};
|
||||
Runnable r = () -> System.out.println("");
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -1,8 +1,6 @@
|
||||
// "Replace with lambda" "true"
|
||||
class Test {
|
||||
{
|
||||
Runnable[] r = new Runnable[] {() -> {
|
||||
System.out.println("");
|
||||
}};
|
||||
Runnable[] r = new Runnable[] {() -> System.out.println("")};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user