summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/ShrinkTree.java12
-rw-r--r--src/main/java/au/id/zancanaro/javacheck/junit/Properties.java2
2 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/au/id/zancanaro/javacheck/ShrinkTree.java b/src/main/java/au/id/zancanaro/javacheck/ShrinkTree.java
index ddef800..9c51a7e 100644
--- a/src/main/java/au/id/zancanaro/javacheck/ShrinkTree.java
+++ b/src/main/java/au/id/zancanaro/javacheck/ShrinkTree.java
@@ -56,20 +56,22 @@ public class ShrinkTree<T> {
public static <T> Stream<ShrinkTree<T>[]> promoteChildren(ShrinkTree<? super T>[] trees) {
return IntStream.range(0, trees.length)
.mapToObj(index -> trees[index].getChildren().map(child ->
- (ShrinkTree<T>[]) IntStream.range(0, trees.length)
+ IntStream.range(0, trees.length)
.mapToObj(i -> (i == index ? child : trees[i]))
- .toArray(ShrinkTree[]::new)))
- .flatMap(x -> x);
+ .toArray(ShrinkTree<?>[]::new)))
+ .flatMap(x -> x)
+ .map(x -> (ShrinkTree<T>[]) x);
}
@SuppressWarnings("unchecked")
public static <T> Stream<ShrinkTree<T>[]> removeChildren(ShrinkTree<? super T>[] trees) {
return IntStream.range(0, trees.length)
.mapToObj(index ->
- (ShrinkTree<T>[]) IntStream.range(0, trees.length)
+ IntStream.range(0, trees.length)
.filter(i -> i != index)
.mapToObj(i -> trees[i])
- .toArray(ShrinkTree[]::new));
+ .toArray(ShrinkTree<?>[]::new))
+ .map(x -> (ShrinkTree<T>[]) x);
}
public static <T> Stream<ShrinkTree<T>[]> removeAndPromoteChildren(ShrinkTree<? super T>[] trees) {
diff --git a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java
index 175cd6c..9e6414a 100644
--- a/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java
+++ b/src/main/java/au/id/zancanaro/javacheck/junit/Properties.java
@@ -85,7 +85,7 @@ public class Properties extends BlockJUnit4ClassRunner {
} else {
Generator<?>[] generators = Arrays.stream(method.getGenericParameterTypes())
.map(param -> provider.getGenerator(param, new Annotation[0], provider))
- .toArray(Generator[]::new);
+ .toArray(Generator<?>[]::new);
Generator<List<Object>> generator = Generator.tuple(generators);
long seed = getSeed(method);