mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 00:11:26 +07:00
type equality constraint: reject type/wildcard pairs; subtyping constraint: become eq constraint for types
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
public class Sample {
|
||||
|
||||
static List<String> getList(Function<Object, String> function, ArrayList<? super String> objects) {
|
||||
return transform(objects, new ArrayList<String>(), function);
|
||||
}
|
||||
|
||||
static <R, S, T extends Collection<S>> T transform(Iterable<? extends R> oldCollection,
|
||||
T newCollection,
|
||||
Function<R, S> function) {
|
||||
|
||||
return newCollection;
|
||||
}
|
||||
|
||||
interface Function<X, Y> {
|
||||
Y apply(X input);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user