3333 |
|
() -> f.exceptionally(null), |
3334 |
|
|
3335 |
|
() -> f.handle(null), |
3336 |
+ |
|
3337 |
|
() -> CompletableFuture.allOf((CompletableFuture<?>)null), |
3338 |
|
() -> CompletableFuture.allOf((CompletableFuture<?>[])null), |
3339 |
|
() -> CompletableFuture.allOf(f, null), |
3360 |
|
} |
3361 |
|
|
3362 |
|
// jdk9 |
3363 |
< |
|
3363 |
> |
|
3364 |
|
/** |
3365 |
|
* newIncompleteFuture returns an incomplete CompletableFuture |
3366 |
|
*/ |
3391 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
3392 |
|
Executor e = f.defaultExecutor(); |
3393 |
|
Executor c = ForkJoinPool.commonPool(); |
3394 |
< |
if (ForkJoinPool.getCommonPoolParallelism() > 0) |
3394 |
> |
if (ForkJoinPool.getCommonPoolParallelism() > 1) |
3395 |
|
assertSame(e, c); |
3396 |
|
} |
3397 |
|
|
3411 |
|
public void testFailedFuture2() { |
3412 |
|
try { |
3413 |
|
CompletableFuture<Integer> f = CompletableFuture.failedFuture(null); |
3414 |
< |
} catch(NullPointerException success) { |
3415 |
< |
} |
3414 |
> |
shouldThrow(); |
3415 |
> |
} catch (NullPointerException success) {} |
3416 |
|
} |
3417 |
|
|
3418 |
|
/** |
3513 |
|
try { |
3514 |
|
f.join(); |
3515 |
|
shouldThrow(); |
3516 |
< |
} catch(Exception success) { |
3516 |
< |
} |
3516 |
> |
} catch (Exception success) {} |
3517 |
|
checkCompletedWithWrappedCFException(f); |
3518 |
|
} |
3519 |
|
|
3538 |
|
try { |
3539 |
|
f.join(); |
3540 |
|
shouldThrow(); |
3541 |
< |
} catch(Exception success) { |
3542 |
< |
} |
3541 |
> |
} catch (Exception success) {} |
3542 |
|
checkCompletedWithWrappedCFException(f); |
3543 |
|
} |
3544 |
|
|
3545 |
|
/** |
3546 |
< |
* orTimeout completes with TimeoutException if not complete |
3546 |
> |
* orTimeout completes with TimeoutException if not complete |
3547 |
|
*/ |
3548 |
|
public void testOrTimeout() { |
3549 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
3552 |
|
} |
3553 |
|
|
3554 |
|
/** |
3555 |
< |
* orTimeout completes normally if completed before timeout |
3555 |
> |
* orTimeout completes normally if completed before timeout |
3556 |
|
*/ |
3557 |
|
public void testOrTimeout2() { |
3558 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
3562 |
|
} |
3563 |
|
|
3564 |
|
/** |
3565 |
< |
* completeOnTimeout completes with given value if not complete |
3565 |
> |
* completeOnTimeout completes with given value if not complete |
3566 |
|
*/ |
3567 |
|
public void testCompleteOnTimeout() { |
3568 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |
3572 |
|
} |
3573 |
|
|
3574 |
|
/** |
3575 |
< |
* completeOnTimeout has no effect if completed within timeout |
3575 |
> |
* completeOnTimeout has no effect if completed within timeout |
3576 |
|
*/ |
3577 |
|
public void testCompleteOnTimeout2() { |
3578 |
|
CompletableFuture<Integer> f = new CompletableFuture<>(); |