4035 |
|
|
4036 |
|
//--- tests of implementation details; not part of official tck --- |
4037 |
|
|
4038 |
+ |
@SuppressWarnings("removal") |
4039 |
|
Object resultOf(CompletableFuture<?> f) { |
4040 |
|
SecurityManager sm = System.getSecurityManager(); |
4041 |
|
if (sm != null) { |
4836 |
|
final AtomicInteger ran = new AtomicInteger(0); |
4837 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
4838 |
|
final DelegatedCompletionStage<Item> d = |
4839 |
< |
new DelegatedCompletionStage<Item>(f); |
4839 |
> |
new DelegatedCompletionStage<>(f); |
4840 |
|
if (!createIncomplete) assertTrue(f.complete(v1)); |
4841 |
|
final CompletionStage<Item> g = d.exceptionallyAsync |
4842 |
|
((Throwable t) -> { |
4862 |
|
final CFException ex = new CFException(); |
4863 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
4864 |
|
final DelegatedCompletionStage<Item> d = |
4865 |
< |
new DelegatedCompletionStage<Item>(f); |
4865 |
> |
new DelegatedCompletionStage<>(f); |
4866 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
4867 |
|
final CompletionStage<Item> g = d.exceptionallyAsync |
4868 |
|
((Throwable t) -> { |
4890 |
|
final CFException ex2 = new CFException(); |
4891 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
4892 |
|
final DelegatedCompletionStage<Item> d = |
4893 |
< |
new DelegatedCompletionStage<Item>(f); |
4893 |
> |
new DelegatedCompletionStage<>(f); |
4894 |
|
if (!createIncomplete) f.completeExceptionally(ex1); |
4895 |
|
final CompletionStage<Item> g = d.exceptionallyAsync |
4896 |
|
((Throwable t) -> { |
4918 |
|
final ExceptionalCompletableFutureFunction r = |
4919 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.SYNC); |
4920 |
|
final DelegatedCompletionStage<Item> d = |
4921 |
< |
new DelegatedCompletionStage<Item>(f); |
4921 |
> |
new DelegatedCompletionStage<>(f); |
4922 |
|
if (!createIncomplete) assertTrue(f.complete(v1)); |
4923 |
|
final CompletionStage<Item> g = d.exceptionallyCompose(r); |
4924 |
|
if (createIncomplete) assertTrue(f.complete(v1)); |
4940 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.SYNC); |
4941 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
4942 |
|
final DelegatedCompletionStage<Item> d = |
4943 |
< |
new DelegatedCompletionStage<Item>(f); |
4943 |
> |
new DelegatedCompletionStage<>(f); |
4944 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
4945 |
|
final CompletionStage<Item> g = d.exceptionallyCompose(r); |
4946 |
|
if (createIncomplete) f.completeExceptionally(ex); |
4962 |
|
final FailingExceptionalCompletableFutureFunction r |
4963 |
|
= new FailingExceptionalCompletableFutureFunction(ExecutionMode.SYNC); |
4964 |
|
final DelegatedCompletionStage<Item> d = |
4965 |
< |
new DelegatedCompletionStage<Item>(f); |
4965 |
> |
new DelegatedCompletionStage<>(f); |
4966 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
4967 |
|
final CompletionStage<Item> g = d.exceptionallyCompose(r); |
4968 |
|
if (createIncomplete) f.completeExceptionally(ex); |
4984 |
|
final ExceptionalCompletableFutureFunction r = |
4985 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.ASYNC); |
4986 |
|
final DelegatedCompletionStage<Item> d = |
4987 |
< |
new DelegatedCompletionStage<Item>(f); |
4987 |
> |
new DelegatedCompletionStage<>(f); |
4988 |
|
if (!createIncomplete) assertTrue(f.complete(v1)); |
4989 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r); |
4990 |
|
if (createIncomplete) assertTrue(f.complete(v1)); |
5006 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.ASYNC); |
5007 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
5008 |
|
final DelegatedCompletionStage<Item> d = |
5009 |
< |
new DelegatedCompletionStage<Item>(f); |
5009 |
> |
new DelegatedCompletionStage<>(f); |
5010 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
5011 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r); |
5012 |
|
if (createIncomplete) f.completeExceptionally(ex); |
5028 |
|
final FailingExceptionalCompletableFutureFunction r |
5029 |
|
= new FailingExceptionalCompletableFutureFunction(ExecutionMode.ASYNC); |
5030 |
|
final DelegatedCompletionStage<Item> d = |
5031 |
< |
new DelegatedCompletionStage<Item>(f); |
5031 |
> |
new DelegatedCompletionStage<>(f); |
5032 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
5033 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r); |
5034 |
|
if (createIncomplete) f.completeExceptionally(ex); |
5050 |
|
final ExceptionalCompletableFutureFunction r = |
5051 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.EXECUTOR); |
5052 |
|
final DelegatedCompletionStage<Item> d = |
5053 |
< |
new DelegatedCompletionStage<Item>(f); |
5053 |
> |
new DelegatedCompletionStage<>(f); |
5054 |
|
if (!createIncomplete) assertTrue(f.complete(v1)); |
5055 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r, new ThreadExecutor()); |
5056 |
|
if (createIncomplete) assertTrue(f.complete(v1)); |
5072 |
|
new ExceptionalCompletableFutureFunction(ExecutionMode.EXECUTOR); |
5073 |
|
final CompletableFuture<Item> f = new CompletableFuture<>(); |
5074 |
|
final DelegatedCompletionStage<Item> d = |
5075 |
< |
new DelegatedCompletionStage<Item>(f); |
5075 |
> |
new DelegatedCompletionStage<>(f); |
5076 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
5077 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r, new ThreadExecutor()); |
5078 |
|
if (createIncomplete) f.completeExceptionally(ex); |
5094 |
|
final FailingExceptionalCompletableFutureFunction r |
5095 |
|
= new FailingExceptionalCompletableFutureFunction(ExecutionMode.EXECUTOR); |
5096 |
|
final DelegatedCompletionStage<Item> d = |
5097 |
< |
new DelegatedCompletionStage<Item>(f); |
5097 |
> |
new DelegatedCompletionStage<>(f); |
5098 |
|
if (!createIncomplete) f.completeExceptionally(ex); |
5099 |
|
final CompletionStage<Item> g = d.exceptionallyComposeAsync(r, new ThreadExecutor()); |
5100 |
|
if (createIncomplete) f.completeExceptionally(ex); |