28 |
|
import java.util.concurrent.atomic.AtomicInteger; |
29 |
|
import java.util.concurrent.locks.ReentrantLock; |
30 |
|
|
31 |
– |
import junit.framework.AssertionFailedError; |
31 |
|
import junit.framework.Test; |
32 |
|
import junit.framework.TestSuite; |
33 |
|
|
109 |
|
return n; |
110 |
|
FibTask f1 = new FibTask(n - 1); |
111 |
|
f1.fork(); |
112 |
< |
return (new FibTask(n - 2)).compute() + f1.join(); |
112 |
> |
return new FibTask(n - 2).compute() + f1.join(); |
113 |
|
} |
114 |
|
} |
115 |
|
|
303 |
|
p.getFactory()); |
304 |
|
while (! p.isQuiescent()) { |
305 |
|
if (millisElapsedSince(startTime) > LONG_DELAY_MS) |
306 |
< |
throw new AssertionFailedError("timed out"); |
306 |
> |
throw new AssertionError("timed out"); |
307 |
|
assertFalse(p.getAsyncMode()); |
308 |
|
assertFalse(p.isShutdown()); |
309 |
|
assertFalse(p.isTerminating()); |
348 |
|
p.shutdown(); |
349 |
|
assertTrue(p.isShutdown()); |
350 |
|
try { |
351 |
< |
ForkJoinTask<Integer> f = p.submit(new FibTask(8)); |
351 |
> |
ForkJoinTask<Integer> unused = p.submit(new FibTask(8)); |
352 |
|
shouldThrow(); |
353 |
|
} catch (RejectedExecutionException success) {} |
354 |
|
} |
536 |
|
ExecutorService e = new ForkJoinPool(1); |
537 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
538 |
|
try { |
539 |
< |
Future<?> future = e.submit((Runnable) null); |
539 |
> |
Future<?> unused = e.submit((Runnable) null); |
540 |
|
shouldThrow(); |
541 |
|
} catch (NullPointerException success) {} |
542 |
|
} |
549 |
|
ExecutorService e = new ForkJoinPool(1); |
550 |
|
try (PoolCleaner cleaner = cleaner(e)) { |
551 |
|
try { |
552 |
< |
Future<String> future = e.submit((Callable) null); |
552 |
> |
Future<String> unused = e.submit((Callable) null); |
553 |
|
shouldThrow(); |
554 |
|
} catch (NullPointerException success) {} |
555 |
|
} |