mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8186265: Make toString() methods of "task" objects more useful
Reviewed-by: martin, psandoz, rriggs, dholmes, darcy
This commit is contained in:
parent
2ea646cc20
commit
229cce5f44
10 changed files with 240 additions and 23 deletions
|
@ -2490,13 +2490,13 @@ public class CompletableFuture<T> implements Future<T>, CompletionStage<T> {
|
|||
for (Completion p = stack; p != null; p = p.next)
|
||||
++count;
|
||||
return super.toString() +
|
||||
((r == null) ?
|
||||
((count == 0) ?
|
||||
"[Not completed]" :
|
||||
"[Not completed, " + count + " dependents]") :
|
||||
(((r instanceof AltResult) && ((AltResult)r).ex != null) ?
|
||||
"[Completed exceptionally]" :
|
||||
"[Completed normally]"));
|
||||
((r == null)
|
||||
? ((count == 0)
|
||||
? "[Not completed]"
|
||||
: "[Not completed, " + count + " dependents]")
|
||||
: (((r instanceof AltResult) && ((AltResult)r).ex != null)
|
||||
? "[Completed exceptionally: " + ((AltResult)r).ex + "]"
|
||||
: "[Completed normally]"));
|
||||
}
|
||||
|
||||
// jdk9 additions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue