--- jsr166/src/test/tck/CountedCompleterTest.java 2017/10/21 06:53:36 1.34 +++ jsr166/src/test/tck/CountedCompleterTest.java 2021/01/26 13:33:05 1.38 @@ -47,7 +47,7 @@ public class CountedCompleterTest extend null, true); } - private void testInvokeOnPool(ForkJoinPool pool, ForkJoinTask a) { + private void testInvokeOnPool(ForkJoinPool pool, ForkJoinTask a) { try (PoolCleaner cleaner = cleaner(pool)) { assertFalse(a.isDone()); assertFalse(a.isCompletedNormally()); @@ -67,7 +67,7 @@ public class CountedCompleterTest extend } } - void checkNotDone(CountedCompleter a) { + void checkNotDone(CountedCompleter a) { assertFalse(a.isDone()); assertFalse(a.isCompletedNormally()); assertFalse(a.isCompletedAbnormally()); @@ -108,13 +108,17 @@ public class CountedCompleterTest extend assertFalse(a.cancel(false)); assertFalse(a.cancel(true)); + + Object v1 = null, v2 = null; try { - assertNull(a.get()); - assertNull(a.get(randomTimeout(), randomTimeUnit())); - } catch (Exception fail) { threadUnexpectedException(fail); } + v1 = a.get(); + v2 = a.get(randomTimeout(), randomTimeUnit()); + } catch (Throwable fail) { threadUnexpectedException(fail); } + assertNull(v1); + assertNull(v2); } - void checkCancelled(CountedCompleter a) { + void checkCancelled(CountedCompleter a) { assertTrue(a.isDone()); assertTrue(a.isCancelled()); assertFalse(a.isCompletedNormally()); @@ -151,7 +155,7 @@ public class CountedCompleterTest extend } catch (Throwable fail) { threadUnexpectedException(fail); } } - void checkCompletedAbnormally(CountedCompleter a, Throwable t) { + void checkCompletedAbnormally(CountedCompleter a, Throwable t) { assertTrue(a.isDone()); assertFalse(a.isCancelled()); assertFalse(a.isCompletedNormally()); @@ -214,19 +218,19 @@ public class CountedCompleterTest extend int setRawResultN() { return setRawResultN.get(); } CheckedCC() { super(); } - CheckedCC(CountedCompleter p) { super(p); } - CheckedCC(CountedCompleter p, int n) { super(p, n); } + CheckedCC(CountedCompleter p) { super(p); } + CheckedCC(CountedCompleter p, int n) { super(p, n); } abstract void realCompute(); public final void compute() { computeN.incrementAndGet(); realCompute(); } - public void onCompletion(CountedCompleter caller) { + public void onCompletion(CountedCompleter caller) { onCompletionN.incrementAndGet(); super.onCompletion(caller); } public boolean onExceptionalCompletion(Throwable ex, - CountedCompleter caller) { + CountedCompleter caller) { onExceptionalCompletionN.incrementAndGet(); assertNotNull(ex); assertTrue(isCompletedAbnormally()); @@ -274,8 +278,8 @@ public class CountedCompleterTest extend final class NoopCC extends CheckedCC { NoopCC() { super(); } - NoopCC(CountedCompleter p) { super(p); } - NoopCC(CountedCompleter p, int initialPendingCount) { + NoopCC(CountedCompleter p) { super(p); } + NoopCC(CountedCompleter p, int initialPendingCount) { super(p, initialPendingCount); } protected void realCompute() {} @@ -396,9 +400,9 @@ public class CountedCompleterTest extend public void testGetCompleter() { NoopCC a = new NoopCC(); assertNull(a.getCompleter()); - CountedCompleter b = new NoopCC(a); + NoopCC b = new NoopCC(a); assertSame(a, b.getCompleter()); - CountedCompleter c = new NoopCC(b); + NoopCC c = new NoopCC(b); assertSame(b, c.getCompleter()); } @@ -521,7 +525,7 @@ public class CountedCompleterTest extend int number; int rnumber; - public CCF(CountedCompleter parent, int n) { + public CCF(CountedCompleter parent, int n) { super(parent, 1); this.number = n; } @@ -539,10 +543,10 @@ public class CountedCompleterTest extend final class LCCF extends CCF { public LCCF(int n) { this(null, n); } - public LCCF(CountedCompleter parent, int n) { + public LCCF(CountedCompleter parent, int n) { super(parent, n); } - public final void onCompletion(CountedCompleter caller) { + public final void onCompletion(CountedCompleter caller) { super.onCompletion(caller); CCF p = (CCF)getCompleter(); int n = number + rnumber; @@ -553,10 +557,10 @@ public class CountedCompleterTest extend } } final class RCCF extends CCF { - public RCCF(CountedCompleter parent, int n) { + public RCCF(CountedCompleter parent, int n) { super(parent, n); } - public final void onCompletion(CountedCompleter caller) { + public final void onCompletion(CountedCompleter caller) { super.onCompletion(caller); CCF p = (CCF)getCompleter(); int n = number + rnumber; @@ -572,7 +576,7 @@ public class CountedCompleterTest extend int number; int rnumber; - public FailingCCF(CountedCompleter parent, int n) { + public FailingCCF(CountedCompleter parent, int n) { super(parent, 1); this.number = n; } @@ -590,10 +594,10 @@ public class CountedCompleterTest extend final class LFCCF extends FailingCCF { public LFCCF(int n) { this(null, n); } - public LFCCF(CountedCompleter parent, int n) { + public LFCCF(CountedCompleter parent, int n) { super(parent, n); } - public final void onCompletion(CountedCompleter caller) { + public final void onCompletion(CountedCompleter caller) { super.onCompletion(caller); FailingCCF p = (FailingCCF)getCompleter(); int n = number + rnumber; @@ -604,10 +608,10 @@ public class CountedCompleterTest extend } } final class RFCCF extends FailingCCF { - public RFCCF(CountedCompleter parent, int n) { + public RFCCF(CountedCompleter parent, int n) { super(parent, n); } - public final void onCompletion(CountedCompleter caller) { + public final void onCompletion(CountedCompleter caller) { super.onCompletion(caller); completeExceptionally(new FJException()); } @@ -619,7 +623,7 @@ public class CountedCompleterTest extend * completed tasks; getRawResult returns null. */ public void testInvoke() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertNull(f.invoke()); @@ -635,7 +639,7 @@ public class CountedCompleterTest extend * completed tasks */ public void testQuietlyInvoke() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); f.quietlyInvoke(); @@ -649,7 +653,7 @@ public class CountedCompleterTest extend * join of a forked task returns when task completes */ public void testForkJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -664,7 +668,7 @@ public class CountedCompleterTest extend * get of a forked task returns when task completes */ public void testForkGet() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -679,7 +683,7 @@ public class CountedCompleterTest extend * timed get of a forked task returns when task completes */ public void testForkTimedGet() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -694,7 +698,7 @@ public class CountedCompleterTest extend * timed get with null time unit throws NPE */ public void testForkTimedGetNPE() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -710,7 +714,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes */ public void testForkQuietlyJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -726,11 +730,13 @@ public class CountedCompleterTest extend * getQueuedTaskCount returns 0 when quiescent */ public void testForkHelpQuiesce() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); helpQuiesce(); + while (!f.isDone()) // wait out race + ; assertEquals(21, f.number); assertEquals(0, getQueuedTaskCount()); checkCompletedNormally(f); @@ -742,7 +748,7 @@ public class CountedCompleterTest extend * invoke task throws exception when task completes abnormally */ public void testAbnormalInvoke() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); try { @@ -759,7 +765,7 @@ public class CountedCompleterTest extend * quietlyInvoke task returns when task completes abnormally */ public void testAbnormalQuietlyInvoke() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); f.quietlyInvoke(); @@ -773,7 +779,7 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task completes abnormally */ public void testAbnormalForkJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -791,7 +797,7 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkGet() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -811,7 +817,7 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkTimedGet() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -831,7 +837,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes abnormally */ public void testAbnormalForkQuietlyJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -846,7 +852,7 @@ public class CountedCompleterTest extend * invoke task throws exception when task cancelled */ public void testCancelledInvoke() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -864,7 +870,7 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task cancelled */ public void testCancelledForkJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -883,7 +889,7 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task cancelled */ public void testCancelledForkGet() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -902,7 +908,7 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task cancelled */ public void testCancelledForkTimedGet() throws Exception { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -921,7 +927,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task cancelled */ public void testCancelledForkQuietlyJoin() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -937,7 +943,7 @@ public class CountedCompleterTest extend */ public void testGetPool() { final ForkJoinPool mainPool = mainPool(); - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { assertSame(mainPool, getPool()); }}; @@ -948,7 +954,7 @@ public class CountedCompleterTest extend * getPool of non-FJ task returns null */ public void testGetPool2() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { assertNull(getPool()); }}; @@ -959,7 +965,7 @@ public class CountedCompleterTest extend * inForkJoinPool of executing task returns true */ public void testInForkJoinPool() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { assertTrue(inForkJoinPool()); }}; @@ -970,7 +976,7 @@ public class CountedCompleterTest extend * inForkJoinPool of non-FJ task returns false */ public void testInForkJoinPool2() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { assertFalse(inForkJoinPool()); }}; @@ -981,7 +987,7 @@ public class CountedCompleterTest extend * setRawResult(null) succeeds */ public void testSetRawResult() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { setRawResult(null); assertNull(getRawResult()); @@ -993,7 +999,7 @@ public class CountedCompleterTest extend * invoke task throws exception after invoking completeExceptionally */ public void testCompleteExceptionally2() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF n = new LCCF(8); CCF f = new LCCF(n, 8); @@ -1009,7 +1015,7 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) invokes all task arguments */ public void testInvokeAll2() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1026,7 +1032,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument invokes task */ public void testInvokeAll1() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); invokeAll(f); @@ -1040,7 +1046,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument invokes tasks */ public void testInvokeAll3() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1060,12 +1066,12 @@ public class CountedCompleterTest extend * invokeAll(collection) invokes all tasks in the collection */ public void testInvokeAllCollection() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); CCF h = new LCCF(7); - HashSet set = new HashSet(); + HashSet set = new HashSet(); set.add(f); set.add(g); set.add(h); @@ -1084,7 +1090,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with any null task throws NPE */ public void testInvokeAllNPE() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1101,7 +1107,7 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) throw exception if any task does */ public void testAbnormalInvokeAll2() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); FailingCCF g = new LFCCF(9); @@ -1119,7 +1125,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument throws exception if task does */ public void testAbnormalInvokeAll1() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF g = new LFCCF(9); try { @@ -1136,7 +1142,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument throws exception if any task does */ public void testAbnormalInvokeAll3() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); FailingCCF g = new LFCCF(9); @@ -1155,12 +1161,12 @@ public class CountedCompleterTest extend * invokeAll(collection) throws exception if any task does */ public void testAbnormalInvokeAllCollection() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); CCF g = new LCCF(9); CCF h = new LCCF(7); - HashSet set = new HashSet(); + HashSet> set = new HashSet>(); set.add(f); set.add(g); set.add(h); @@ -1179,7 +1185,7 @@ public class CountedCompleterTest extend * and suppresses execution */ public void testTryUnfork() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1198,7 +1204,7 @@ public class CountedCompleterTest extend * there are more tasks than threads */ public void testGetSurplusQueuedTaskCount() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF h = new LCCF(7); assertSame(h, h.fork()); @@ -1220,7 +1226,7 @@ public class CountedCompleterTest extend * peekNextLocalTask returns most recent unexecuted task. */ public void testPeekNextLocalTask() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1240,7 +1246,7 @@ public class CountedCompleterTest extend * executing it */ public void testPollNextLocalTask() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1259,7 +1265,7 @@ public class CountedCompleterTest extend * pollTask returns an unexecuted task without executing it */ public void testPollTask() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1277,7 +1283,7 @@ public class CountedCompleterTest extend * peekNextLocalTask returns least recent unexecuted task in async mode */ public void testPeekNextLocalTaskAsync() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1298,7 +1304,7 @@ public class CountedCompleterTest extend * executing it, in async mode */ public void testPollNextLocalTaskAsync() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1318,7 +1324,7 @@ public class CountedCompleterTest extend * async mode */ public void testPollTaskAsync() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF g = new LCCF(9); assertSame(g, g.fork()); @@ -1341,7 +1347,7 @@ public class CountedCompleterTest extend * completed tasks; getRawResult returns null. */ public void testInvokeSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertNull(f.invoke()); @@ -1357,7 +1363,7 @@ public class CountedCompleterTest extend * completed tasks */ public void testQuietlyInvokeSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); f.quietlyInvoke(); @@ -1371,7 +1377,7 @@ public class CountedCompleterTest extend * join of a forked task returns when task completes */ public void testForkJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1386,7 +1392,7 @@ public class CountedCompleterTest extend * get of a forked task returns when task completes */ public void testForkGetSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1401,7 +1407,7 @@ public class CountedCompleterTest extend * timed get of a forked task returns when task completes */ public void testForkTimedGetSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1416,7 +1422,7 @@ public class CountedCompleterTest extend * timed get with null time unit throws NPE */ public void testForkTimedGetNPESingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1432,7 +1438,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes */ public void testForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1448,7 +1454,7 @@ public class CountedCompleterTest extend * getQueuedTaskCount returns 0 when quiescent */ public void testForkHelpQuiesceSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertSame(f, f.fork()); @@ -1464,7 +1470,7 @@ public class CountedCompleterTest extend * invoke task throws exception when task completes abnormally */ public void testAbnormalInvokeSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); try { @@ -1481,7 +1487,7 @@ public class CountedCompleterTest extend * quietlyInvoke task returns when task completes abnormally */ public void testAbnormalQuietlyInvokeSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); f.quietlyInvoke(); @@ -1495,7 +1501,7 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task completes abnormally */ public void testAbnormalForkJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -1513,7 +1519,7 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkGetSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -1533,7 +1539,7 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task completes abnormally */ public void testAbnormalForkTimedGetSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -1553,7 +1559,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task completes abnormally */ public void testAbnormalForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); assertSame(f, f.fork()); @@ -1568,7 +1574,7 @@ public class CountedCompleterTest extend * invoke task throws exception when task cancelled */ public void testCancelledInvokeSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -1586,7 +1592,7 @@ public class CountedCompleterTest extend * join of a forked task throws exception when task cancelled */ public void testCancelledForkJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -1605,7 +1611,7 @@ public class CountedCompleterTest extend * get of a forked task throws exception when task cancelled */ public void testCancelledForkGetSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -1624,7 +1630,7 @@ public class CountedCompleterTest extend * timed get of a forked task throws exception when task cancelled */ public void testCancelledForkTimedGetSingleton() throws Exception { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() throws Exception { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -1643,7 +1649,7 @@ public class CountedCompleterTest extend * quietlyJoin of a forked task returns when task cancelled */ public void testCancelledForkQuietlyJoinSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); assertTrue(f.cancel(true)); @@ -1658,7 +1664,7 @@ public class CountedCompleterTest extend * invoke task throws exception after invoking completeExceptionally */ public void testCompleteExceptionallySingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF n = new LCCF(8); CCF f = new LCCF(n, 8); @@ -1674,7 +1680,7 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) invokes all task arguments */ public void testInvokeAll2Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1691,7 +1697,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument invokes task */ public void testInvokeAll1Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); invokeAll(f); @@ -1705,7 +1711,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument invokes tasks */ public void testInvokeAll3Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1725,12 +1731,12 @@ public class CountedCompleterTest extend * invokeAll(collection) invokes all tasks in the collection */ public void testInvokeAllCollectionSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); CCF h = new LCCF(7); - HashSet set = new HashSet(); + HashSet> set = new HashSet>(); set.add(f); set.add(g); set.add(h); @@ -1749,7 +1755,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with any null task throws NPE */ public void testInvokeAllNPESingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); CCF g = new LCCF(9); @@ -1766,7 +1772,7 @@ public class CountedCompleterTest extend * invokeAll(t1, t2) throw exception if any task does */ public void testAbnormalInvokeAll2Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); FailingCCF g = new LFCCF(9); @@ -1784,7 +1790,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with 1 argument throws exception if task does */ public void testAbnormalInvokeAll1Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF g = new LFCCF(9); try { @@ -1801,7 +1807,7 @@ public class CountedCompleterTest extend * invokeAll(tasks) with > 2 argument throws exception if any task does */ public void testAbnormalInvokeAll3Singleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { CCF f = new LCCF(8); FailingCCF g = new LFCCF(9); @@ -1820,12 +1826,12 @@ public class CountedCompleterTest extend * invokeAll(collection) throws exception if any task does */ public void testAbnormalInvokeAllCollectionSingleton() { - ForkJoinTask a = new CheckedRecursiveAction() { + CheckedRecursiveAction a = new CheckedRecursiveAction() { protected void realCompute() { FailingCCF f = new LFCCF(8); CCF g = new LCCF(9); CCF h = new LCCF(7); - HashSet set = new HashSet(); + HashSet> set = new HashSet>(); set.add(f); set.add(g); set.add(h);