Skip to content

Commit 17efc98

Browse files
committed
remove old workaround for javac bugs that have been fixed.
1 parent 794f9b9 commit 17efc98

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

core/src/main/java/fj/control/Trampoline.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,12 @@ public <B> Trampoline<B> bind(final F<A, Trampoline<B>> f) {
5252
// The resumption of a Codense is the resumption of its subcomputation. If that computation is done, its result
5353
// gets shifted into the continuation.
5454
public Either<P1<Trampoline<A>>, A> resume() {
55-
return left(sub.resume().either(p -> p.map(ot -> {
56-
// WARNING: In JDK 8, update 25 (current version) the following code is a
57-
// workaround for an internal JDK compiler error, likely due to
58-
// https:bugs.openjdk.java.net/browse/JDK-8062253.
59-
F<Normal<Object>, Trampoline<A>> f = o -> o.foldNormal(cont, t -> t._1().bind(cont));
60-
F<Codense<Object>, Trampoline<A>> g = c -> codense(c.sub, o -> c.cont.f(o).bind(cont));
61-
return ot.fold(f, g);
62-
}), o -> P.lazy(() -> cont.f(o))));
55+
return left(sub.resume().either(p -> p.map(ot ->
56+
ot.fold(
57+
o -> o.foldNormal(cont, t -> t._1().bind(cont)),
58+
c -> codense(c.sub, o -> c.cont.f(o).bind(cont))
59+
)
60+
), o -> P.lazy(() -> cont.f(o))));
6361
}
6462
}
6563

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

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ public final Iterator<A> iterator() {
8888
* @return The length of this list.
8989
*/
9090
public final int length() {
91-
// WARNING: In JDK 8, update 25 (current version) the following code triggers an internal JDK compiler error, likely due to https://bugs.openjdk.java.net/browse/JDK-8062253. The code below is a workaround for this compiler bug.
92-
// return foldLeft(i -> a -> i + 1, 0);
93-
F2<Integer, A, Integer> f = (i, a) -> i + 1;
94-
return foldLeft(f, 0);
91+
return foldLeft((i, a) -> i + 1, 0);
9592
}
9693

9794
/**

0 commit comments

Comments
 (0)