--- jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 01:50:30 1.71 +++ jsr166/src/test/tck/ThreadPoolExecutorTest.java 2015/10/04 01:52:43 1.72 @@ -274,12 +274,11 @@ public class ThreadPoolExecutorTest exte new ThreadPoolExecutor(1, 2, LONG_DELAY_MS, MILLISECONDS, new ArrayBlockingQueue(10)); - try { - p.setThreadFactory(null); - shouldThrow(); - } catch (NullPointerException success) { - } finally { - joinPool(p); + try (PoolCleaner cleaner = cleaner(p)) { + try { + p.setThreadFactory(null); + shouldThrow(); + } catch (NullPointerException success) {} } }