redundant cast: ensure cast is not removed if operand changes it's type

This commit is contained in:
Anna.Kozlova
2016-04-29 13:48:06 +02:00
parent f52458abdf
commit b936f89275
2 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
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)));
}
}