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.149 by dl, Wed Jan 14 19:26:49 2015 UTC vs.
Revision 1.150 by dl, Wed Jan 14 20:04:27 2015 UTC

# Line 93 | Line 93 | import java.util.function.Supplier;
93   *     return myExecutor; }
94   *   public void obtrudeValue(T value) {
95   *     throw new UnsupportedOperationException(); }
96 < *    public void obtrudeException(Throwable ex) {
96 > *   public void obtrudeException(Throwable ex) {
97   *     throw new UnsupportedOperationException(); }
98   * }}</pre>
99   *
# Line 1589 | Line 1589 | public class CompletableFuture<T> implem
1589      @SuppressWarnings("serial")
1590      static final class AsyncSupply<T> extends ForkJoinTask<Void>
1591          implements Runnable, AsynchronousCompletionTask {
1592 <        CompletableFuture<T> dep; Supplier<T> fn;
1593 <        AsyncSupply(CompletableFuture<T> dep, Supplier<T> fn) {
1592 >        CompletableFuture<T> dep; Supplier<? extends T> fn;
1593 >        AsyncSupply(CompletableFuture<T> dep, Supplier<? extends T> fn) {
1594              this.dep = dep; this.fn = fn;
1595          }
1596  
# Line 1599 | Line 1599 | public class CompletableFuture<T> implem
1599          public final boolean exec() { run(); return true; }
1600  
1601          public void run() {
1602 <            CompletableFuture<T> d; Supplier<T> f;
1602 >            CompletableFuture<T> d; Supplier<? extends T> f;
1603              if ((d = dep) != null && (f = fn) != null) {
1604                  dep = null; fn = null;
1605                  if (d.result == null) {
# Line 2460 | Line 2460 | public class CompletableFuture<T> implem
2460       * @return this CompletableFuture
2461       * @since 1.9
2462       */
2463 <    public CompletableFuture<T> completeAsync(Supplier<T> supplier,
2463 >    public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier,
2464                                                Executor executor) {
2465          if (supplier == null || executor == null)
2466              throw new NullPointerException();
# Line 2478 | Line 2478 | public class CompletableFuture<T> implem
2478       * @return this CompletableFuture
2479       * @since 1.9
2480       */
2481 <    public CompletableFuture<T> completeAsync(Supplier<T> supplier) {
2481 >    public CompletableFuture<T> completeAsync(Supplier<? extends T> supplier) {
2482          return completeAsync(supplier, defaultExecutor());
2483      }
2484  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines