mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
anonymous -> lambda: enable casts again (IDEA-157960)
This commit is contained in:
+28
@@ -0,0 +1,28 @@
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
class Ambiguous {
|
||||
public void setRoots(List<String> roots) {}
|
||||
|
||||
public static <T> List<T> concat(Iterable<? extends Collection<T>> list) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T> List<T> concat(List<List<? extends T>> lists) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T,V> List<V> map(Collection<? extends T> iterable, Function<T, V> mapping) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
public void anonymousToLambda(HashSet<String> modules) {
|
||||
setRoots(Ambiguous.concat(Ambiguous.map(modules, (Function<String, List<String>>) s -> null)
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
import static java.util.Collections.emptyList;
|
||||
|
||||
class Ambiguous {
|
||||
public void setRoots(List<String> roots) {}
|
||||
|
||||
public static <T> List<T> concat(Iterable<? extends Collection<T>> list) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T> List<T> concat(List<List<? extends T>> lists) {
|
||||
return new ArrayList<T>();
|
||||
}
|
||||
|
||||
public static <T,V> List<V> map(Collection<? extends T> iterable, Function<T, V> mapping) {
|
||||
return emptyList();
|
||||
}
|
||||
|
||||
public void anonymousToLambda(HashSet<String> modules) {
|
||||
setRoots(Ambiguous.concat(Ambiguous.map(modules, (Function<String, List<String>>) s -> Arrays.asList(""))
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
class A {
|
||||
{
|
||||
bar(new Throwabl<caret>eComputable<String, Exception>() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
import java.util.*;
|
||||
class Test2 {
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "false"
|
||||
// "Replace with lambda" "true"
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
|
||||
Reference in New Issue
Block a user