Skip to content

Commit 9f489c9

Browse files
committed
Fix compile warnings.
1 parent 7b3cdae commit 9f489c9

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

core/src/test/java/fj/FWFunctionsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ public class FWFunctionsTest {
99
@Test
1010
public void testLift1() {
1111
F<Integer, Integer> f = i -> i + 1;
12-
F1W f1w = F1W.lift(f);
12+
F1W<Integer, Integer> f1w = F1W.lift(f);
1313
assertThat(f1w.f(1), is(2));
1414
}
1515

1616
@Test
1717
public void testLift2() {
1818
F2<Integer, Integer, Integer> f2 = (i, j) -> i + j;
19-
F2W f2w = F2W.lift(f2);
19+
F2W<Integer, Integer, Integer> f2w = F2W.lift(f2);
2020
assertThat(f2w.f(1, 2), is(3));
2121
}
2222

core/src/test/java/fj/TryEffectTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,15 @@ public class TryEffectTest {
1111

1212
@Test
1313
public void testTryEffect0Success() {
14-
F<TryEffect0, Validation<TryEffectException, Unit>> f =
15-
TryEffect.f(TryEffect0<TryEffectException>::f);
14+
F<TryEffect0<TryEffectException>, Validation<TryEffectException, Unit>> f = TryEffect.f(TryEffect0::f);
1615
Validation<TryEffectException, Unit> v = f.f(new AlwaysSucceed0());
1716
assertThat(v.isSuccess(), is(true));
1817
assertThat(v.success(), is(Unit.unit()));
1918
}
2019

2120
@Test
2221
public void testTryEffect0Fail() {
23-
F<TryEffect0, Validation<TryEffectException, Unit>> f =
24-
TryEffect.f(TryEffect0<TryEffectException>::f);
22+
F<TryEffect0<TryEffectException>, Validation<TryEffectException, Unit>> f = TryEffect.f(TryEffect0::f);
2523
Validation<TryEffectException, Unit> v = f.f(new AlwaysFail0());
2624
assertThat(v.isFail(), is(true));
2725
assertThat(v.fail(), is(new TryEffectException()));

core/src/test/java/fj/control/parallel/StrategyTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import fj.Ord;
44
import fj.P;
55
import fj.P1;
6+
import fj.Unit;
67
import fj.data.Enumerator;
78
import fj.data.List;
89
import fj.data.Stream;
@@ -41,7 +42,7 @@ public void testStrategyExecutor() {
4142
public void testStrategyCompletion() {
4243
final Stream<Integer> s = range(Enumerator.intEnumerator, 99, -99, -1);
4344
final ExecutorService es = Executors.newFixedThreadPool(10);
44-
final CompletionService cs = new ExecutorCompletionService(es);
45+
final CompletionService<Unit> cs = new ExecutorCompletionService<>(es);
4546
assertThat(s.sort(Ord.intOrd, completionStrategy(cs)), is(s.sort(Ord.intOrd)));
4647
}
4748

props-core/src/test/java/fj/MemoisationTest.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import org.junit.runner.RunWith;
77

88
import static fj.test.Arbitrary.arbInteger;
9+
import static fj.test.Arbitrary.arbString;
910
import static fj.test.CheckResult.summary;
1011
import static fj.test.Property.prop;
1112
import static fj.test.Property.property;
@@ -25,16 +26,16 @@ public Property test1() {
2526
}
2627

2728
public Property test1_hardMemo() {
28-
return property(arbInteger, a -> {
29-
P1<Integer> t = P.hardMemo(() -> new Integer(a));
29+
return property(arbString, a -> {
30+
P1<String> t = P.hardMemo(() -> new String(a));
3031
return prop(t._1() == t._1()).and(prop(t._1().equals(a)));
3132
});
3233
}
3334

3435
@Test
3536
public Property test2() {
36-
return property(arbInteger, arbInteger, (a, b) -> {
37-
P2<Integer, Integer> t = P.lazy(u -> new Integer(a), u -> new Integer(b)).memo();
37+
return property(arbString, arbString, (a, b) -> {
38+
P2<String, String> t = P.lazy(u -> new String(a), u -> new String(b)).memo();
3839
return prop(t._1().equals(t._1()) && t._1().equals(a) && t._2().equals(t._2()) && t._2().equals(b) );
3940
});
4041
}

props-core/src/test/java/fj/data/fingertrees/FingerTreeTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,16 @@ void validateOperations(List<Integer> list) {
4242
@Test
4343
public void testHeadOption() {
4444
assertThat(Empty.emptyIntAddition().headOption(), is(Option.none()));
45-
FingerTree<Integer, Integer> ft = new MakeTree(measured(intAdditionMonoid, Function.constant(1))).single(1);
45+
FingerTree<Integer, Integer> ft = new MakeTree<Integer, Integer>(measured(intAdditionMonoid, Function.constant(1)))
46+
.single(1);
4647
assertThat(ft.headOption(), is(Option.some(1)));
4748
}
4849

4950
@Test
5051
public void testUncons() {
5152
assertThat(Empty.emptyIntAddition().uncons(0, (h, t) -> h), is(0));
52-
FingerTree<Integer, Integer> ft = new MakeTree(measured(intAdditionMonoid, Function.constant(1))).single(1);
53+
FingerTree<Integer, Integer> ft = new MakeTree<Integer, Integer>(measured(intAdditionMonoid, Function.constant(1)))
54+
.single(1);
5355
assertThat(ft.uncons(0, (h, t) -> h), is(1));
5456
}
5557

0 commit comments

Comments
 (0)