mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-17 20:11:25 +07:00
IDEA-216467 "Lambda can be replaced with method reference" does not detect all cases with varargs
GitOrigin-RevId: 232800df8754a17bc8358640b675bc5a8903dfce
This commit is contained in:
committed by
intellij-monorepo-bot
parent
dca558d695
commit
b0929155eb
@@ -0,0 +1,10 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
BiFunction<String, String, List<String>> f3 = Arrays::asList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.Function;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
Function<String, Example> f1 = Example::new;
|
||||
}
|
||||
public Example(String a, String... b) {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
BiFunction<String, String, Example> f3 = Example::new;
|
||||
}
|
||||
public Example(String a, String... b) {}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
BiFunction<String, String, List<String>> f3 = (a, b) -> Arrays.<caret>asList(a, b);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.Function;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
Function<String, Example> f1 = a -> new<caret> Example(a);
|
||||
}
|
||||
public Example(String a, String... b) {}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
// "Replace lambda with method reference" "true"
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
class Example {
|
||||
public static void main(String[] args) {
|
||||
BiFunction<String, String, Example> f3 = (a, b) -> new<caret> Example(a, b);
|
||||
}
|
||||
public Example(String a, String... b) {}
|
||||
}
|
||||
Reference in New Issue
Block a user