[concurrency-interest] More Javadoc problems

Josh Humphries jh at squareup.com
Fri Dec 19 09:42:43 EST 2014


Looking at the source code -- the ultimate spec ;) -- the original
exception is preferred. So in your example, the resulting CompletionStage
completes exceptionally with exception1, and exception2 is effectively
eaten.

----
*Josh Humphries*
Manager, Shared Systems  |  Platform Engineering
Atlanta, GA  |  678-400-4867
*Square* (www.squareup.com)

On Fri, Dec 19, 2014 at 9:00 AM, cowwoc <cowwoc at bbs.darktech.org> wrote:
>
> Hi guys,
>
> The Javadoc for CompletableFuture.whenComplete() reads:
>
> "If the supplied action itself encounters an exception, then the returned
> stage exceptionally completes with this exception unless this stage also
> completed exceptionally."
>
> Huh?!
>
> So if the original stage completed with exception1 but the handler threw
> exception2, which exception does the returned CompleteableFuture complete
> with? The specification says what *won't* happen if the stage also
> completed
> exceptionally, but it doesn't say what *will* happen. Please clarify :)
>
> Thanks,
> Gili
>
>
>
> --
> View this message in context:
> http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669.html
> Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141219/0dbe4674/attachment.html>


More information about the Concurrency-interest mailing list