mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 17:07:05 +07:00
restrict anonym -> lambda: reject if return type would be changed (IDEA-154805)
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "true"
|
||||
// "Replace with lambda" "false"
|
||||
class A {
|
||||
{
|
||||
bar(new Throwabl<caret>eComputable<String, Exception>() {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// "Replace with lambda" "true"
|
||||
// "Replace with lambda" "false"
|
||||
import java.util.*;
|
||||
class Test2 {
|
||||
|
||||
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// "Replace with lambda" "false"
|
||||
|
||||
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, new Function<String, List<String>>() {
|
||||
@Override
|
||||
public List<String> apply(String s) {
|
||||
return null;
|
||||
}
|
||||
})
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user