8 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
9 |
|
|
10 |
|
import java.util.Arrays; |
11 |
– |
import java.util.Collections; |
11 |
|
import java.util.concurrent.CountDownLatch; |
12 |
|
import java.util.concurrent.ExecutionException; |
13 |
|
import java.util.concurrent.ForkJoinPool; |
920 |
|
AsyncFib f = new AsyncFib(8); |
921 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
922 |
|
ForkJoinTask[] tasks = { f, g }; |
923 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
923 |
> |
shuffle(tasks); |
924 |
|
try { |
925 |
|
invokeAll(tasks[0], tasks[1]); |
926 |
|
shouldThrow(); |
947 |
|
FailingAsyncFib g = new FailingAsyncFib(9); |
948 |
|
AsyncFib h = new AsyncFib(7); |
949 |
|
ForkJoinTask[] tasks = { f, g, h }; |
950 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
950 |
> |
shuffle(tasks); |
951 |
|
try { |
952 |
|
invokeAll(tasks[0], tasks[1], tasks[2]); |
953 |
|
shouldThrow(); |
974 |
|
AsyncFib g = new AsyncFib(9); |
975 |
|
AsyncFib h = new AsyncFib(7); |
976 |
|
ForkJoinTask[] tasks = { f, g, h }; |
977 |
< |
Collections.shuffle(Arrays.asList(tasks)); |
977 |
> |
shuffle(tasks); |
978 |
|
try { |
979 |
|
invokeAll(Arrays.asList(tasks)); |
980 |
|
shouldThrow(); |