96 |
|
assertNull(a.join()); |
97 |
|
assertFalse(a.cancel(false)); |
98 |
|
assertFalse(a.cancel(true)); |
99 |
+ |
|
100 |
+ |
Object v1 = null, v2 = null; |
101 |
|
try { |
102 |
< |
assertNull(a.get()); |
103 |
< |
assertNull(a.get(randomTimeout(), randomTimeUnit())); |
104 |
< |
} catch (Exception fail) { threadUnexpectedException(fail); } |
102 |
> |
v1 = a.get(); |
103 |
> |
v2 = a.get(randomTimeout(), randomTimeUnit()); |
104 |
> |
} catch (Throwable fail) { threadUnexpectedException(fail); } |
105 |
> |
assertNull(v1); |
106 |
> |
assertNull(v2); |
107 |
|
} |
108 |
|
|
109 |
|
void checkCancelled(RecursiveAction a) { |
329 |
|
* succeeds in the presence of interrupts |
330 |
|
*/ |
331 |
|
public void testJoinIgnoresInterruptsOutsideForkJoinPool() { |
332 |
< |
final SynchronousQueue<FibAction[]> sq = |
329 |
< |
new SynchronousQueue<FibAction[]>(); |
332 |
> |
final SynchronousQueue<FibAction[]> sq = new SynchronousQueue<>(); |
333 |
|
RecursiveAction a = new CheckedRecursiveAction() { |
334 |
|
protected void realCompute() throws InterruptedException { |
335 |
|
FibAction[] fibActions = new FibAction[6]; |
341 |
|
fibActions[4].cancel(true); |
342 |
|
fibActions[5].completeExceptionally(new FJException()); |
343 |
|
|
344 |
< |
for (int i = 0; i < fibActions.length; i++) |
345 |
< |
fibActions[i].fork(); |
344 |
> |
for (FibAction fibAction : fibActions) |
345 |
> |
fibAction.fork(); |
346 |
|
|
347 |
|
sq.put(fibActions); |
348 |
|
|
920 |
|
FibAction f = new FibAction(8); |
921 |
|
FibAction g = new FibAction(9); |
922 |
|
FibAction h = new FibAction(7); |
923 |
< |
HashSet set = new HashSet(); |
923 |
> |
HashSet<ForkJoinTask<?>> set = new HashSet<>(); |
924 |
|
set.add(f); |
925 |
|
set.add(g); |
926 |
|
set.add(h); |
1018 |
|
FailingFibAction f = new FailingFibAction(8); |
1019 |
|
FibAction g = new FibAction(9); |
1020 |
|
FibAction h = new FibAction(7); |
1021 |
< |
HashSet set = new HashSet(); |
1021 |
> |
HashSet<ForkJoinTask<?>> set = new HashSet<>(); |
1022 |
|
set.add(f); |
1023 |
|
set.add(g); |
1024 |
|
set.add(h); |