Skip to content

Commit 9853c6a

Browse files
committed
Added unchecked and safe var args warning suppression
1 parent ddc8fe4 commit 9853c6a

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

core/src/main/java/fj/data/Array.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ public static <A> Array<A> empty() {
571571
* @param a The elements to construct the array with.
572572
* @return A new array of the given elements.
573573
*/
574+
@SafeVarargs
574575
public static <A> Array<A> array(final A... a) {
575576
return new Array<A>(a);
576577
}

quickcheck/src/main/java/fj/test/Arbitrary.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ public Array<A> f(final List<A> as) {
778778
* @param aa An arbitrary implementation for the type over which the sequence is defined.
779779
* @return An arbitrary implementation for sequences.
780780
*/
781+
@SuppressWarnings("unchecked")
781782
public static <A> Arbitrary<Seq<A>> arbSeq(final Arbitrary<A> aa) {
782783
return arbitrary(arbArray(aa).gen.map(array -> Seq.seq((A[]) array.array())));
783784
}

quickcheck/src/main/java/fj/test/Gen.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ public Gen<A> f(final A a) {
514514
* @param as The values that the returned generator may produce.
515515
* @return A generator that produces values from the given arguments.
516516
*/
517+
@SafeVarargs
517518
public static <A> Gen<A> elements(final A... as) {
518519
return array(as).isEmpty() ? Gen.<A>fail() : choose(0, as.length - 1).map(new F<Integer, A>() {
519520
public A f(final Integer i) {

quickcheck/src/main/java/fj/test/Variant.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ private Variant() {
4949
* @param g The generator to produce the new generator from.
5050
* @return A generator that is independent of the given generator using the given value.
5151
*/
52+
@SuppressWarnings("unchecked")
5253
public static <A> Gen<A> variant(final long n, final Gen<A> g) {
5354
final LongGen p = new LongGen(n, g);
5455
final Gen<?> gx = variantMemo.get(p);

0 commit comments

Comments
 (0)