--- jsr166/src/test/tck/ForkJoinPoolTest.java 2015/10/02 21:52:36 1.56 +++ jsr166/src/test/tck/ForkJoinPoolTest.java 2015/10/03 16:57:25 1.57 @@ -981,8 +981,9 @@ public class ForkJoinPoolTest extends JS * timed invokeAll(c) returns results of all completed tasks in c */ public void testTimedInvokeAll5() throws Throwable { - ExecutorService e = new ForkJoinPool(1); - try { + try (PoolCloser poolCloser + = new PoolCloser(new ForkJoinPool(1))) { + ForkJoinPool e = poolCloser.pool; List> l = new ArrayList>(); l.add(new StringTask()); l.add(new StringTask()); @@ -991,8 +992,6 @@ public class ForkJoinPoolTest extends JS assertEquals(2, futures.size()); for (Future future : futures) assertSame(TEST_STRING, future.get()); - } finally { - joinPool(e); } }