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.29 by dl, Wed Jan 2 17:37:18 2013 UTC vs.
Revision 1.30 by dl, Wed Jan 2 18:20:22 2013 UTC

# Line 2634 | Line 2634 | public class CompletableFuture<T> implem
2634       * completed. This method is designed for use only in error
2635       * recovery actions, and even in such situations may result in
2636       * ongoing dependent completions using established versus
2637 <     * overwritten values.
2637 >     * overwritten outcomes.
2638       *
2639       * @param value the completion value
2640       */
# Line 2643 | Line 2643 | public class CompletableFuture<T> implem
2643          postComplete();
2644      }
2645  
2646 +    /**
2647 +     * Forcibly causes subsequent invocations of method get() and
2648 +     * related methods to throw the given exception, whether or not
2649 +     * already completed. This method is designed for use only in
2650 +     * recovery actions, and even in such situations may result in
2651 +     * ongoing dependent completions using established versus
2652 +     * overwritten outcomes.
2653 +     *
2654 +     * @param ex the exception
2655 +     */
2656 +    public void obtrudeException(Throwable ex) {
2657 +        if (ex == null) throw new NullPointerException();
2658 +        result = new AltResult(ex);
2659 +        postComplete();
2660 +    }
2661 +
2662      // Unsafe mechanics
2663      private static final sun.misc.Unsafe UNSAFE;
2664      private static final long RESULT;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines