--- jsr166/src/test/tck/CompletableFutureTest.java 2018/11/24 18:24:14 1.218 +++ jsr166/src/test/tck/CompletableFutureTest.java 2018/11/24 18:33:26 1.219 @@ -926,17 +926,19 @@ public class CompletableFutureTest exten for (boolean createIncomplete : new boolean[] { true, false }) for (Integer v1 : new Integer[] { 1, null }) { + final AtomicInteger ran = new AtomicInteger(0); final CompletableFuture f = new CompletableFuture<>(); if (!createIncomplete) assertTrue(f.complete(v1)); final CompletableFuture g = m.exceptionally (f, (Throwable t) -> { - threadFail("should not be called"); - return null; // unreached + ran.getAndIncrement(); + throw new AssertionError("should not be called"); }); if (createIncomplete) assertTrue(f.complete(v1)); checkCompletedNormally(g, v1); checkCompletedNormally(f, v1); + assertEquals(0, ran.get()); }} /** @@ -4829,18 +4831,21 @@ public class CompletableFutureTest exten for (boolean createIncomplete : new boolean[] { true, false }) for (Integer v1 : new Integer[] { 1, null }) { + final AtomicInteger ran = new AtomicInteger(0); final CompletableFuture f = new CompletableFuture<>(); final DelegatedCompletionStage d = new DelegatedCompletionStage(f); if (!createIncomplete) assertTrue(f.complete(v1)); final CompletionStage g = d.exceptionallyAsync ((Throwable t) -> { - threadFail("should not be called"); - return null; // unreached + ran.getAndIncrement(); + throw new AssertionError("should not be called"); }); if (createIncomplete) assertTrue(f.complete(v1)); checkCompletedNormally(g.toCompletableFuture(), v1); + checkCompletedNormally(f, v1); + assertEquals(0, ran.get()); }} /**