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.60 by jsr166, Sun Mar 17 19:38:08 2013 UTC vs.
Revision 1.61 by jsr166, Sun Mar 17 22:24:02 2013 UTC

# Line 562 | Line 562 | public class CompletableFuture<T> implem
562              if ((d = this.dst) != null && d.result == null) {
563                  try {
564                      fr = fn.apply(arg);
565 <                    ex = null;
565 >                    ex = (fr == null) ? new NullPointerException() : null;
566                  } catch (Throwable rex) {
567                      ex = rex;
568                      fr = null;
569                  }
570                  if (ex != null)
571                      u = null;
572                else if (fr == null) {
573                    ex = new NullPointerException();
574                    u = null;
575                }
572                  else {
573                      Object r = fr.result;
574                      if (r instanceof AltResult) {
# Line 2660 | Line 2656 | public class CompletableFuture<T> implem
2656                  }
2657                  else {
2658                      try {
2659 <                        dst = fn.apply(t);
2659 >                        if ((dst = fn.apply(t)) == null)
2660 >                            ex = new NullPointerException();
2661                      } catch (Throwable rex) {
2662                          ex = rex;
2663                      }
2664 <                    if (dst == null) {
2664 >                    if (dst == null)
2665                          dst = new CompletableFuture<U>();
2669                        if (ex == null)
2670                            ex = new NullPointerException();
2671                    }
2666                  }
2667              }
2668              if (e == null && ex != null)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines