IDEA-112552 "Replace with lambda" should use expression lambda when possible

This commit is contained in:
Anna Kozlova
2014-04-08 18:28:25 +02:00
parent 16dca7cf21
commit 2fa8491e90
7 changed files with 14 additions and 23 deletions
@@ -7,9 +7,7 @@ class Test {
interface InOutEx extends InOut {
InOut bind() {
return () -> {
foo();
};
return () -> foo();
}
}
}
@@ -6,8 +6,6 @@ class Test {
}
InOut bind() {
return () -> {
InOut.foo();
};
return () -> InOut.foo();
}
}
@@ -4,10 +4,7 @@ class HelloLambda {
HelloLambda() {
x = 1;
Runnable r = () -> {
System.out.println(x);
};
Runnable r = () -> System.out.println(x);
}
@@ -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,8 +1,6 @@
// "Replace with lambda" "true"
class Test {
{
Runnable r = () -> {
System.out.println("");
};
Runnable r = () -> System.out.println("");
}
}
@@ -1,8 +1,6 @@
// "Replace with lambda" "true"
class Test {
{
Runnable[] r = new Runnable[] {() -> {
System.out.println("");
}};
Runnable[] r = new Runnable[] {() -> System.out.println("")};
}
}