3438 |
|
CompletableFuture<Integer> nullFuture = (CompletableFuture<Integer>)null; |
3439 |
|
ThreadExecutor exec = new ThreadExecutor(); |
3440 |
|
|
3441 |
< |
Runnable[] throwingActions = { |
3441 |
> |
assertThrows( |
3442 |
> |
NullPointerException.class, |
3443 |
> |
|
3444 |
|
() -> CompletableFuture.supplyAsync(null), |
3445 |
|
() -> CompletableFuture.supplyAsync(null, exec), |
3446 |
|
() -> CompletableFuture.supplyAsync(new IntegerSupplier(ExecutionMode.SYNC, 42), null), |
3543 |
|
() -> f.completeOnTimeout(42, 1L, null), |
3544 |
|
|
3545 |
|
() -> CompletableFuture.failedFuture(null), |
3546 |
< |
() -> CompletableFuture.failedStage(null), |
3545 |
< |
}; |
3546 |
> |
() -> CompletableFuture.failedStage(null)); |
3547 |
|
|
3547 |
– |
assertThrows(NullPointerException.class, throwingActions); |
3548 |
|
assertEquals(0, exec.count.get()); |
3549 |
|
} |
3550 |
|
|
4190 |
|
// Manufacture boxed primitives for primitive params |
4191 |
|
for (int i = 0; i < args.length; i++) { |
4192 |
|
Class<?> type = parameterTypes[i]; |
4193 |
< |
if (parameterTypes[i] == boolean.class) |
4194 |
< |
args[i] = false; |
4195 |
< |
else if (parameterTypes[i] == int.class) |
4196 |
< |
args[i] = 0; |
4197 |
< |
else if (parameterTypes[i] == long.class) |
4198 |
< |
args[i] = 0L; |
4193 |
> |
if (type == boolean.class) args[i] = false; |
4194 |
> |
else if (type == int.class) args[i] = 0; |
4195 |
> |
else if (type == long.class) args[i] = 0L; |
4196 |
|
} |
4197 |
|
for (CompletionStage<Integer> stage : stages) { |
4198 |
|
try { |
4868 |
|
if (createIncomplete) f.completeExceptionally(ex); |
4869 |
|
|
4870 |
|
checkCompletedNormally(g.toCompletableFuture(), v1); |
4871 |
+ |
checkCompletedExceptionally(f, ex); |
4872 |
|
assertEquals(1, ran.get()); |
4873 |
|
}} |
4874 |
|
|