--- jsr166/src/test/tck/ExecutorCompletionServiceTest.java 2021/01/26 13:33:06 1.30 +++ jsr166/src/test/tck/ExecutorCompletionServiceTest.java 2021/01/27 01:57:24 1.31 @@ -57,7 +57,7 @@ public class ExecutorCompletionServiceTe * ecs.submit(null) throws NullPointerException */ public void testSubmitNullCallable() { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); try { cs.submit((Callable) null); shouldThrow(); @@ -68,7 +68,7 @@ public class ExecutorCompletionServiceTe * ecs.submit(null, val) throws NullPointerException */ public void testSubmitNullRunnable() { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); try { cs.submit((Runnable) null, Boolean.TRUE); shouldThrow(); @@ -79,7 +79,7 @@ public class ExecutorCompletionServiceTe * A taken submitted task is completed */ public void testTake() throws Exception { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); cs.submit(new StringTask()); Future f = cs.take(); assertTrue(f.isDone()); @@ -90,7 +90,7 @@ public class ExecutorCompletionServiceTe * Take returns the same future object returned by submit */ public void testTake2() throws InterruptedException { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); Future f1 = cs.submit(new StringTask()); Future f2 = cs.take(); assertSame(f1, f2); @@ -100,7 +100,7 @@ public class ExecutorCompletionServiceTe * poll returns non-null when the returned task is completed */ public void testPoll1() throws Exception { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); assertNull(cs.poll()); cs.submit(new StringTask()); @@ -119,7 +119,7 @@ public class ExecutorCompletionServiceTe * timed poll returns non-null when the returned task is completed */ public void testPoll2() throws Exception { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); assertNull(cs.poll()); cs.submit(new StringTask()); @@ -139,7 +139,7 @@ public class ExecutorCompletionServiceTe * poll returns null before the returned task is completed */ public void testPollReturnsNullBeforeCompletion() throws Exception { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); final CountDownLatch proceed = new CountDownLatch(1); cs.submit(new Callable() { public String call() throws Exception { await(proceed); @@ -159,7 +159,7 @@ public class ExecutorCompletionServiceTe * successful and failed tasks are both returned */ public void testTaskAssortment() throws Exception { - CompletionService cs = new ExecutorCompletionService(cachedThreadPool); + CompletionService cs = new ExecutorCompletionService<>(cachedThreadPool); ArithmeticException ex = new ArithmeticException(); final int rounds = 2; for (int i = rounds; i--> 0; ) {