trivial functional expressions usage (IDEA-131090)

This commit is contained in:
Anna Kozlova
2016-01-12 13:45:16 +01:00
parent e789f65554
commit fee6bc1ba5
12 changed files with 296 additions and 0 deletions
@@ -0,0 +1,9 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
class Test {
{
String s = "";
String str = s;
}
}
@@ -0,0 +1,6 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
class Test {
String s = "";
}
@@ -0,0 +1,10 @@
// "Replace method call on method reference with corresponding method call" "true"
import java.util.function.Supplier;
class Test {
String s = foo();
private String foo() {
return null;
}
}
@@ -0,0 +1,11 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
class Test {
{
String str = ((Supplier<String>)() -> {
String s = "";
return s;
}).g<caret>et();
}
}
@@ -0,0 +1,9 @@
// "Replace method call on lambda with lambda body" "false"
import java.util.function.Supplier;
class Test {
String str = ((Supplier<String>) () -> {
String s = "";
return s;
}).g<caret>et();
}
@@ -0,0 +1,8 @@
// "Replace method call on lambda with lambda body" "true"
import java.util.function.Supplier;
class Test {
String s = ((Supplier<String>) () -> {
return "";
}).g<caret>et();
}
@@ -0,0 +1,10 @@
// "Replace method call on method reference with corresponding method call" "true"
import java.util.function.Supplier;
class Test {
String s = ((Supplier<String>) this::foo).ge<caret>t();
private String foo() {
return null;
}
}
@@ -0,0 +1,6 @@
// "Replace method call on method reference with corresponding method call" "false"
import java.util.function.Supplier;
class Test {
String s = ((Supplier<String>) this::foo).ge<caret>t();
}