GeezerVison is showing github.com — make implicit throw explicit for readability · functionaljava/functionaljava@dd14dd4
File treeExpand file treeCollapse file tree Open diff view settings quickcheck/src/main/java/fj/test
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: quickcheck/src/main/java/fj/test/Arbitrary.java +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -981,7 +981,7 @@ public static <K, V> Arbitrary<fj.data.TreeMap<K, V>> arbTreeMap(Ord<K> ord, Arb | 981 | 981 | public static <K, V> Arbitrary<fj.data.TreeMap<K, V>> arbTreeMap(Ord<K> ord, Arbitrary<K> ak, Arbitrary<V> av, Arbitrary<Integer> ai) { | 982 | 982 | Gen<List<P2<K, V>>> gl2 = ai.gen.bind(i -> { | 983 | 983 | if (i < 0) { | 984 | | - Bottom.error("Undefined: arbitrary natural is negative (" + i + ")"); | | 984 | + throw Bottom.error("Undefined: arbitrary natural is negative (" + i + ")"); | 985 | 985 | } | 986 | 986 | return Gen.sequenceN(Math.max(i, 0), arbP2(ak, av).gen); | 987 | 987 | }); | @@ -993,7 +993,7 @@ public static <K, V> Arbitrary<fj.data.TreeMap<K, V>> arbTreeMap(Ord<K> ord, Arb | 993 | 993 | */ | 994 | 994 | public static <K, V> Arbitrary<fj.data.TreeMap<K, V>> arbTreeMap(Ord<K> ord, Arbitrary<K> ak, Arbitrary<V> av, int maxSize) { | 995 | 995 | if (maxSize < 0) { | 996 | | - Bottom.error("Undefined: arbitrary natural is negative (" + maxSize + ")"); | | 996 | + throw Bottom.error("Undefined: arbitrary natural is negative (" + maxSize + ")"); | 997 | 997 | } | 998 | 998 | return arbTreeMap(ord, ak, av, arbitrary(choose(0, maxSize))); | 999 | 999 | } | |
|