inline method to method reference: convert to lambda (IDEA-148481)

This commit is contained in:
Anna Kozlova
2016-01-11 18:53:47 +01:00
parent 53c8b26ae7
commit d8ea1bc2fe
12 changed files with 406 additions and 253 deletions
@@ -0,0 +1,15 @@
import java.util.function.Supplier;
public class Test {
public Test() {
this(0);
}
public Test(int i) {}
{
Supplier<Test> sup = Test::ne<caret>w;
}
}
@@ -0,0 +1,15 @@
import java.util.function.Supplier;
public class Test {
public Test() {
this(0);
}
public Test(int i) {}
{
Supplier<Test> sup = () -> new Test(0);
}
}
@@ -0,0 +1,11 @@
import java.util.function.Supplier;
class Test {
{
Supplier<String> sup = this::g<caret>et;
}
private String get() {
return null;
}
}
@@ -0,0 +1,11 @@
import java.util.function.Supplier;
class Test {
{
Supplier<String> sup = () -> null;
}
private String get() {
return null;
}
}
@@ -0,0 +1,13 @@
import java.util.function.Supplier;
public class Test {
{
Supplier<String> sup = new Test()::get;
}
private String ge<caret>t() {
return null;
}
}