ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CompletableFuture.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CompletableFuture.java (file contents):
Revision 1.39 by jsr166, Tue Feb 5 19:54:06 2013 UTC vs.
Revision 1.40 by jsr166, Wed Feb 6 06:57:14 2013 UTC

# Line 3059 | Line 3059 | public class CompletableFuture<T> implem
3059  
3060      /**
3061       * Returns a string identifying this CompletableFuture, as well as
3062 <     * its completion state.  The state, in brackets, includes the
3062 >     * its completion state.  The state, in brackets, contains the
3063       * String {@code "Completed Normally"} or the String {@code
3064       * "Completed Exceptionally"}, or the String {@code "Not
3065       * completed"} followed by the number of CompletableFutures
# Line 3068 | Line 3068 | public class CompletableFuture<T> implem
3068       * @return a string identifying this CompletableFuture, as well as its state
3069       */
3070      public String toString() {
3071        String id = super.toString();
3072        int count = getNumberOfDependents();
3071          Object r = result;
3072 <        Throwable ex = (r != null && (r instanceof AltResult) ?
3073 <                        ((AltResult)r).ex : null);
3074 <        return id + (ex != null ? "[Completed exceptionally]" :
3075 <                     (r != null ? "[Completed normally]" :
3076 <                      (count == 0 ? "[Not completed]" :
3077 <                       ("[Not completed, " + count + " dependents]"))));
3072 >        int count;
3073 >        return super.toString() +
3074 >            ((r == null) ?
3075 >             (((count = getNumberOfDependents()) == 0) ?
3076 >              "[Not completed]" :
3077 >              "[Not completed, " + count + " dependents]") :
3078 >             (((r instanceof AltResult) && ((AltResult)r).ex != null) ?
3079 >              "[Completed exceptionally]" :
3080 >              "[Completed normally]"));
3081      }
3082  
3083      // Unsafe mechanics

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines