mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
trivial functional expressions usage (IDEA-131090)
This commit is contained in:
+9
@@ -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;
|
||||
}
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
// "Replace method call on lambda with lambda body" "true"
|
||||
import java.util.function.Supplier;
|
||||
|
||||
class Test {
|
||||
String s = "";
|
||||
}
|
||||
+10
@@ -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;
|
||||
}
|
||||
}
|
||||
+11
@@ -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();
|
||||
}
|
||||
}
|
||||
+9
@@ -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();
|
||||
}
|
||||
+8
@@ -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();
|
||||
}
|
||||
+10
@@ -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;
|
||||
}
|
||||
}
|
||||
+6
@@ -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();
|
||||
}
|
||||
Reference in New Issue
Block a user