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

Comparing jsr166/src/jsr166e/CompletableFuture.java (file contents):
Revision 1.6 by jsr166, Wed Jan 9 02:51:36 2013 UTC vs.
Revision 1.11 by jsr166, Wed Feb 6 07:51:57 2013 UTC

# Line 388 | Line 388 | public class CompletableFuture<T> implem
388      }
389  
390      /** Base class can act as either FJ or plain Runnable */
391 <    static abstract class Async extends ForkJoinTask<Void>
391 >    abstract static class Async extends ForkJoinTask<Void>
392          implements Runnable, AsynchronousCompletionTask {
393          public final Void getRawResult() { return null; }
394          public final void setRawResult(Void v) { }
# Line 557 | Line 557 | public class CompletableFuture<T> implem
557      }
558  
559      // Opportunistically subclass AtomicInteger to use compareAndSet to claim.
560 <    static abstract class Completion extends AtomicInteger implements Runnable {
560 >    abstract static class Completion extends AtomicInteger implements Runnable {
561      }
562  
563      static final class ApplyCompletion<T,U> extends Completion {
# Line 2449 | Line 2449 | public class CompletableFuture<T> implem
2449       * then the returned CompletableFuture also does so, with a
2450       * CompletionException holding this exception as its cause.
2451       *
2452 <     * @param fn the function returning a new CompletableFuture.
2452 >     * @param fn the function returning a new CompletableFuture
2453       * @return the CompletableFuture, that {@code isDone()} upon
2454       * return if completed by the given function, or an exception
2455 <     * occurs.
2455 >     * occurs
2456       */
2457      public <U> CompletableFuture<U> thenCompose(Fun<? super T,
2458                                                  CompletableFuture<U>> fn) {
# Line 2633 | Line 2633 | public class CompletableFuture<T> implem
2633       */
2634      public boolean isCancelled() {
2635          Object r;
2636 <        return ((r = result) != null &&
2637 <                (r instanceof AltResult) &&
2638 <                (((AltResult)r).ex instanceof CancellationException));
2636 >        return ((r = result) instanceof AltResult) &&
2637 >            (((AltResult)r).ex instanceof CancellationException);
2638      }
2639  
2640      /**
2641       * Forcibly sets or resets the value subsequently returned by
2642 <     * method get() and related methods, whether or not already
2643 <     * completed. This method is designed for use only in error
2644 <     * recovery actions, and even in such situations may result in
2645 <     * ongoing dependent completions using established versus
2642 >     * method {@link #get()} and related methods, whether or not
2643 >     * already completed. This method is designed for use only in
2644 >     * error recovery actions, and even in such situations may result
2645 >     * in ongoing dependent completions using established versus
2646       * overwritten outcomes.
2647       *
2648       * @param value the completion value
# Line 2654 | Line 2653 | public class CompletableFuture<T> implem
2653      }
2654  
2655      /**
2656 <     * Forcibly causes subsequent invocations of method get() and
2657 <     * related methods to throw the given exception, whether or not
2658 <     * already completed. This method is designed for use only in
2656 >     * Forcibly causes subsequent invocations of method {@link #get()}
2657 >     * and related methods to throw the given exception, whether or
2658 >     * not already completed. This method is designed for use only in
2659       * recovery actions, and even in such situations may result in
2660       * ongoing dependent completions using established versus
2661       * overwritten outcomes.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines