Skip to content

Commit 2a27fa8

Browse files
committed
Remove unnecessary qualification of static methods
1 parent df48c32 commit 2a27fa8

33 files changed

Lines changed: 127 additions & 127 deletions

core/src/main/java/fj/Equal.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public static <A> Equal<Set<A>> setEqual(final Equal<A> e) {
538538
}
539539

540540
public static <K, V> Equal<TreeMap<K, V>> treeMapEqual(Equal<K> k, Equal<V> v) {
541-
return equal(t1 -> t2 -> Equal.streamEqual(p2Equal(k, v)).eq(t1.toStream(), t2.toStream()));
541+
return equal(t1 -> t2 -> streamEqual(p2Equal(k, v)).eq(t1.toStream(), t2.toStream()));
542542
}
543543

544544
public static <A, B> Equal<Writer<A, B>> writerEqual(Equal<A> eq1, Equal<B> eq2) {

core/src/main/java/fj/F1Functions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public static <A, B> F<A, IterableW<B>> iterableK(final F<A, B> f) {
330330
*/
331331
@SuppressWarnings("unchecked")
332332
public static <A, B> F<Iterable<A>, IterableW<B>> mapIterable(final F<A, B> f) {
333-
return F1Functions.o(IterableW.<A, B>map().f(f), IterableW.<A, Iterable<A>>wrap());
333+
return o(IterableW.<A, B>map().f(f), IterableW.<A, Iterable<A>>wrap());
334334
}
335335

336336
/**

core/src/main/java/fj/Function.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static <A, B, C, D> F<A, F<B, D>> compose2(final F<C, D> f, final F<A, F<
6060
* @return A function that composes two functions to produce a new function.
6161
*/
6262
public static <A, B, C> F<F<A, B>, F<F<B, C>, F<A, C>>> andThen() {
63-
return g -> f -> Function.andThen(g, f);
63+
return g -> f -> andThen(g, f);
6464
}
6565

6666
/**

core/src/main/java/fj/Hash.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ public static <A> Hash<Tree<A>> treeHash(final Hash<A> ha) {
268268
}
269269

270270
public static <K, V> Hash<TreeMap<K, V>> treeMapHash(final Hash<K> h, final Hash<V> v) {
271-
return hash(t -> streamHash(Hash.p2Hash(h, v)).hash(t.toStream()));
271+
return hash(t -> streamHash(p2Hash(h, v)).hash(t.toStream()));
272272
}
273273

274274
/**

core/src/main/java/fj/P.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ public H _8() {
234234
}
235235

236236
public static <A, B> P2<A, B> lazyProduct(F0<P2<A, B>> f) {
237-
return P.lazy(() -> f.f()._1(), () -> f.f()._2());
237+
return lazy(() -> f.f()._1(), () -> f.f()._2());
238238
}
239239

240240
/**
@@ -552,7 +552,7 @@ public static <A> P1<A> lazy(F<Unit, A> f) {
552552
}
553553

554554
public static <A, B> P2<A, B> lazy(F<Unit, A> fa, F<Unit, B> fb) {
555-
return P.lazy(() -> fa.f(unit()), () -> fb.f(unit()));
555+
return lazy(() -> fa.f(unit()), () -> fb.f(unit()));
556556
}
557557

558558
public static <A, B, C> P3<A, B, C> lazy(F<Unit, A> fa, F<Unit, B> fb, F<Unit, C> fc) {

core/src/main/java/fj/Show.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ public static <A> Show<A> showS(final F<A, String> f) {
159159
* @return A show instance that uses {@link Object#toString()} to perform the display rendering.
160160
*/
161161
public static <A> Show<A> anyShow() {
162-
return show(a -> Stream.fromString((a == null) ? "null" : a.toString()));
162+
return show(a -> fromString((a == null) ? "null" : a.toString()));
163163
}
164164

165165
/**
@@ -325,7 +325,7 @@ public static <A> Show<Set<A>> setShow(final Show<A> sa) {
325325
public static <K, V> Show<TreeMap<K, V>> treeMapShow(final Show<K> sk, final Show<V> sv) {
326326
return show(tm -> {
327327
Stream<P2<K, V>> stream = Stream.iteratorStream(tm.iterator());
328-
return streamShow(Show.p2MapShow(sk, sv), "TreeMap(", ",", ")").show(stream);
328+
return streamShow(p2MapShow(sk, sv), "TreeMap(", ",", ")").show(stream);
329329
});
330330
}
331331

@@ -425,7 +425,7 @@ public static <A> Show<P1<A>> p1Show(final Show<A> sa) {
425425
}
426426

427427
public static <A> Show<P1<A>> p1ShowLazy(final Show<A> sa) {
428-
return show(p -> Stream.fromString("(?)"));
428+
return show(p -> fromString("(?)"));
429429
}
430430

431431
public static <A> Show<P1<A>> p1ShowEager(final Show<A> sa) {

core/src/main/java/fj/Try.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public static <A, E extends Exception> P1<Validation<E, A>> f(final Try0<A, E> t
4545
public static <A, B, E extends Exception> F<A, Validation<E, B>> f(final Try1<A, B, E> t) {
4646
return a -> {
4747
try {
48-
return Validation.success(t.f(a));
48+
return success(t.f(a));
4949
} catch (Exception e) {
5050
return fail((E) e);
5151
}

core/src/main/java/fj/control/parallel/Callables.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public static <A, B> Callable<B> bind(final Callable<A> a, final F<A, Callable<B
9393
* @return That function lifted to a function on Callables.
9494
*/
9595
public static <A, B> F<Callable<A>, Callable<B>> fmap(final F<A, B> f) {
96-
return a -> Callables.bind(a, callable(f));
96+
return a -> bind(a, callable(f));
9797
}
9898

9999
/**

core/src/main/java/fj/control/parallel/Promise.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void f(final P2<Either<P1<A>, Actor<A>>, Promise<A>> p) {
7575
*/
7676
public static <A> Promise<A> promise(final Strategy<Unit> s, final P1<A> a) {
7777
final Promise<A> p = mkPromise(s);
78-
p.actor.act(P.p(Either.<P1<A>, Actor<A>>left(a), p));
78+
p.actor.act(p(Either.<P1<A>, Actor<A>>left(a), p));
7979
return p;
8080
}
8181

@@ -118,7 +118,7 @@ public static <A, B> F<A, Promise<B>> promise(final Strategy<Unit> s, final F<A,
118118
* @param a An actor that will receive this Promise's value in the future.
119119
*/
120120
public void to(final Actor<A> a) {
121-
actor.act(P.p(Either.<P1<A>, Actor<A>>right(a), this));
121+
actor.act(p(Either.<P1<A>, Actor<A>>right(a), this));
122122
}
123123

124124
/**
@@ -176,7 +176,7 @@ public <B> Promise<B> bind(final F<A, Promise<B>> f) {
176176
final Promise<B> r = mkPromise(s);
177177
final Actor<B> ab = actor(s, new Effect1<B>() {
178178
public void f(final B b) {
179-
r.actor.act(P.p(Either.<P1<B>, Actor<B>>left(P.p(b)), r));
179+
r.actor.act(p(Either.<P1<B>, Actor<B>>left(p(b)), r));
180180
}
181181
});
182182
to(ab.promise().contramap(f));
@@ -233,7 +233,7 @@ public static <A, B, C> F<Promise<A>, F<Promise<B>, Promise<C>>> liftM2(final F<
233233
* @return A single promise for the given List.
234234
*/
235235
public static <A> Promise<List<A>> sequence(final Strategy<Unit> s, final List<Promise<A>> as) {
236-
return join(foldRight(s, liftM2(List.<A>cons()), promise(s, P.p(List.<A>nil()))).f(as));
236+
return join(foldRight(s, liftM2(List.<A>cons()), promise(s, p(List.<A>nil()))).f(as));
237237
}
238238

239239
/**
@@ -254,7 +254,7 @@ public static <A> F<List<Promise<A>>, Promise<List<A>>> sequence(final Strategy<
254254
* @return A single promise for the given Stream.
255255
*/
256256
public static <A> Promise<Stream<A>> sequence(final Strategy<Unit> s, final Stream<Promise<A>> as) {
257-
return join(foldRightS(s, curry((Promise<A> o, P1<Promise<Stream<A>>> p) -> o.bind(a -> p._1().fmap(Stream.<A>cons_().f(a)))), promise(s, P.p(Stream.<A>nil()))).f(as));
257+
return join(foldRightS(s, curry((Promise<A> o, P1<Promise<Stream<A>>> p) -> o.bind(a -> p._1().fmap(Stream.<A>cons_().f(a)))), promise(s, p(Stream.<A>nil()))).f(as));
258258
}
259259

260260
/**
@@ -289,7 +289,7 @@ public static <A> Promise<P1<A>> sequence(final Strategy<Unit> s, final P1<Promi
289289
public static <A, B> F<List<A>, Promise<B>> foldRight(final Strategy<Unit> s, final F<A, F<B, B>> f, final B b) {
290290
return new F<List<A>, Promise<B>>() {
291291
public Promise<B> f(final List<A> as) {
292-
return as.isEmpty() ? promise(s, p(b)) : liftM2(f).f(promise(s, P.p(as.head()))).f(
292+
return as.isEmpty() ? promise(s, p(b)) : liftM2(f).f(promise(s, p(as.head()))).f(
293293
join(s, P1.curry(this).f(as.tail())));
294294
}
295295
};
@@ -307,7 +307,7 @@ public static <A, B> F<Stream<A>, Promise<B>> foldRightS(final Strategy<Unit> s,
307307
final B b) {
308308
return new F<Stream<A>, Promise<B>>() {
309309
public Promise<B> f(final Stream<A> as) {
310-
return as.isEmpty() ? promise(s, P.p(b)) : liftM2(f).f(promise(s, P.p(as.head()))).f(
310+
return as.isEmpty() ? promise(s, p(b)) : liftM2(f).f(promise(s, p(as.head()))).f(
311311
Promise.<P1<B>>join(s, P.lazy(() -> f(as.tail()._1()).fmap(P.<B>p1()))));
312312
}
313313
};

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ public static <A, B> P2<Array<A>, Array<B>> unzip(final Array<P2<A, B>> xs) {
859859
aa.set(i, p._1());
860860
ab.set(i, p._2());
861861
}
862-
return P.p(aa, ab);
862+
return p(aa, ab);
863863
}
864864

865865
/**
@@ -1074,8 +1074,8 @@ public static <T, U> T[] copyOf(final U[] a, final int len, final Class<? extend
10741074
final T[] copy = (Object)newType == Object[].class
10751075
? (T[]) new Object[len]
10761076
: (T[]) java.lang.reflect.Array.newInstance(newType.getComponentType(), len);
1077-
System.arraycopy(a, 0, copy, 0,
1078-
Math.min(a.length, len));
1077+
arraycopy(a, 0, copy, 0,
1078+
min(a.length, len));
10791079
return copy;
10801080
}
10811081

@@ -1089,8 +1089,8 @@ public static char[] copyOfRange(final char[] a, final int from, final int to) {
10891089
if (len < 0)
10901090
throw new IllegalArgumentException(from + " > " + to);
10911091
final char[] copy = new char[len];
1092-
System.arraycopy(a, from, copy, 0,
1093-
Math.min(a.length - from, len));
1092+
arraycopy(a, from, copy, 0,
1093+
min(a.length - from, len));
10941094
return copy;
10951095
}
10961096
}

0 commit comments

Comments
 (0)