lambda -> meth ref: varargs

This commit is contained in:
Anna Kozlova
2014-11-12 12:20:39 +01:00
parent 89d1df1dc0
commit 1d2a8e0571
4 changed files with 38 additions and 1 deletions

View File

@@ -0,0 +1,9 @@
// "Replace lambda with method reference" "true"
class Example {
public void m(String... s) {
}
{
Runnable r = this::m;
}
}

View File

@@ -0,0 +1,9 @@
// "Replace lambda with method reference" "true"
class Example {
public void m(String... s) {
}
{
Runnable r = () -> <caret>m();
}
}

View File

@@ -0,0 +1,12 @@
// "Replace lambda with method reference" "false"
import java.util.function.Function;
class Example {
public String m(String... s) {
return "";
}
{
Function<String, String> r = (s) -> m(s, s);
}
}