mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
Java: Change test implementation to avoid failing CFG dead end consistency test.
This commit is contained in:
@@ -11,154 +11,152 @@ public class Stream<T> {
|
||||
}
|
||||
|
||||
public boolean allMatch(Predicate<? super T> predicate) {
|
||||
throw null;
|
||||
return false;
|
||||
}
|
||||
|
||||
public <R> R collect(Supplier<R> supplier, BiConsumer<R, ? super T> accumulator, BiConsumer<R, R> combiner) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Collector is not a functional interface, so this is not supported
|
||||
public <R, A> R collect(Collector<? super T, A, R> collector) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> Stream<T> concat(Stream<? extends T> a, Stream<? extends T> b) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> distinct() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T> Stream<T> empty() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> filter(Predicate<? super T> predicate) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Optional<T> findAny() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Optional<T> findFirst() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// public <R> Stream<R> flatMap(Function<? super T, ? extends Stream<? extends
|
||||
// R>> mapper) {
|
||||
// throw null;
|
||||
// return null;
|
||||
// }
|
||||
|
||||
public DoubleStream flatMapToDouble(Function<? super T, ? extends DoubleStream> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public IntStream flatMapToInt(Function<? super T, ? extends IntStream> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public LongStream flatMapToLong(Function<? super T, ? extends LongStream> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void forEach(Consumer<? super T> action) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public void forEachOrdered(Consumer<? super T> action) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public static <T> Stream<T> generate(Supplier<T> s) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Model generator adds a couple of extra models, which can't be
|
||||
// dismissed based on the type information.
|
||||
public static <T> Stream<T> iterate(T seed, UnaryOperator<T> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> limit(long maxSize) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <R> Stream<R> map(Function<? super T, ? extends R> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public DoubleStream mapToDouble(ToDoubleFunction<? super T> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public IntStream mapToInt(ToIntFunction<? super T> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public LongStream mapToLong(ToLongFunction<? super T> mapper) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Optional<T> max(Comparator<? super T> comparator) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Optional<T> min(Comparator<? super T> comparator) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean noneMatch(Predicate<? super T> predicate) {
|
||||
throw null;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Issue with model generator. ... is not supported.
|
||||
// public static <T> Stream<T> of(T... t) {
|
||||
// throw null;
|
||||
// return null;
|
||||
// }
|
||||
|
||||
public static <T> Stream<T> of(T t) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> peek(Consumer<? super T> action) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Model generator yields a couple of extra results as models are generated for
|
||||
// writing to the stream.
|
||||
public Optional<T> reduce(BinaryOperator<T> accumulator) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Model generator yields a couple of extra results as models are generated for
|
||||
// writing to the stream.
|
||||
public T reduce(T identity, BinaryOperator<T> accumulator) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <U> U reduce(U identity, BiFunction<U, ? super T, U> accumulator, BinaryOperator<U> combiner) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> skip(long n) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> sorted() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Stream<T> sorted(Comparator<? super T> comparator) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Models can never be generated correctly based on the type information
|
||||
// as it involves downcasting.
|
||||
public Object[] toArray() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
// Issue with model generator - no models are generated.
|
||||
|
||||
@@ -6,18 +6,16 @@ import java.util.ArrayList;
|
||||
public class TypeBasedCollection<T> extends ArrayList<T> {
|
||||
|
||||
public void addT(T x) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public void addManyT(List<T> xs) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public T firstT() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public List<T> getManyT() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -6,54 +6,52 @@ import java.util.function.Function;
|
||||
public class TypeBasedComplex<T> {
|
||||
|
||||
public void addMany(List<T> xs) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public List<T> getMany() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public Integer apply(Function<T, Integer> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <T1, T2> T2 apply2(T1 x, Function<T1, T2> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public TypeBasedComplex<T> flatMap(Function<T, List<T>> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S> TypeBasedComplex<S> flatMap2(Function<T, List<S>> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S> S map(Function<T, S> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S> TypeBasedComplex<S> mapComplex(Function<T, S> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public TypeBasedComplex<T> returnComplex(Function<T, TypeBasedComplex<T>> f) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void set(Integer x, Function<Integer, T> f) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public Integer applyMyFunction(MyFunction<T, Integer, T> f, Integer x) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S1, S2> S2 applyMyFunctionGeneric(MyFunction<T, S1, S2> f, S1 x) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S1, S2, S3> S3 applyMyFunctionGeneric(MyFunction<S1, S2, S3> f, S1 x, S2 y) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -2,11 +2,10 @@ package p;
|
||||
|
||||
public class TypeBasedSimple<T> {
|
||||
public TypeBasedSimple(T t) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public T get() {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public T get(Object o) {
|
||||
@@ -14,22 +13,19 @@ public class TypeBasedSimple<T> {
|
||||
}
|
||||
|
||||
public T id(T x) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public <S> S id2(S x) {
|
||||
throw null;
|
||||
return null;
|
||||
}
|
||||
|
||||
public void set(T x) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public void set(int x, T y) {
|
||||
throw null;
|
||||
}
|
||||
|
||||
public <S> void set2(S x) { // No summary as S is unrelated to T
|
||||
throw null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user