<div dir="ltr">I do not disagree. Though one thing to note of this approach is that "observers" of the original completion stage (that failed with exception 1) will now witness side effects from a *successor* completion stage via the suppressed exception. It might be a little odd for some consumers to see the state of the Throwable change <i>after</i> it has already been (potentially) published to multiple threads.<div><br></div><div>I would personally vote that the later completion stage fail exceptionally with exception2. But that's a change in behavior that is likely to be a non-starter due to being incompatible with the current spec (even if only slightly).<br></div><div><br></div><div><div>The actual authors of the library are on this list and can likely chime in further about why it behaves that way.</div></div><div><br></div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">----<div><b><font color="#000099">Josh Humphries</font></b></div><div><div><span style="color:rgb(153,153,153);font-family:arial;font-size:small">Manager, Shared Systems  |  Platform Engineering</span><br></div><div><font color="#999999">Atlanta, GA  |  678-400-4867</font></div></div><div><b style="color:rgb(0,0,0)">Square</b><font color="#000000"> (</font><a href="http://www.squareup.com" target="_blank"><font color="#999999">www.squareup.com</font></a><font color="#000000">)</font></div></div></div></div>
<br><div class="gmail_quote">On Fri, Dec 19, 2014 at 9:50 AM, cowwoc <span dir="ltr"><<a href="mailto:cowwoc@bbs.darktech.org" target="_blank">cowwoc@bbs.darktech.org</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  
    <div>Hi Josh,<br>
      <br>
      Thanks for the follow-up.<br>
      <br>
      I'd like to request two changes:<br>
      <ol>
        <li>Add exception2 as a suppressed exception (eating exceptions
          is like silent failures... it's bad business)<br>
        </li>
        <li>Have the Javadoc to mention what will happen in this case.</li>
      </ol>
      <p><br>
        Let me know what you think.<br>
      </p>
      <p>Thanks,<br>
        Gili<br>
      </p><span class="">
      On 19/12/2014 9:42 AM, Josh Humphries [via JSR166 Concurrency]
      wrote:<br>
    </span></div>
    <blockquote style="border-left:2px solid #cccccc;padding:0 1em" type="cite"><span class="">
      <div dir="ltr">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.</div>
      </span><div class="gmail_extra"><span class=""><br clear="all">
        <div>
          <div>
            <div dir="ltr">----
              <div><b><font color="#000099">Josh Humphries</font></b></div>
              <div>
                <div><span style="color:rgb(153,153,153);font-family:arial;font-size:small">Manager,
                    Shared Systems  |  Platform Engineering</span><br>
                </div>
                <div><font color="#999999">Atlanta, GA  |  <a href="tel:678-400-4867" value="+16784004867" target="_blank">678-400-4867</a></font></div>
              </div>
              <div><b style="color:rgb(0,0,0)">Square</b><font color="#000000"> (</font><a href="http://www.squareup.com" rel="nofollow" link="external" target="_blank"><font color="#999999">www.squareup.com</font></a><font color="#000000">)</font></div>
            </div>
          </div>
        </div>
        <br>
        </span><div class="gmail_quote"><span class="">On Fri, Dec 19, 2014 at 9:00 AM, cowwoc
          <span dir="ltr"><<a href="http:///user/SendEmail.jtp?type=node&node=11671&i=0" rel="nofollow" link="external" target="_blank">[hidden
              email]</a>></span> wrote:
          </span><blockquote style="border-left:2px solid #cccccc;padding:0 1em" class="gmail_quote"><span class="">Hi guys,<br>
            <br>
            The Javadoc for CompletableFuture.whenComplete() reads:<br>
            <br>
            "If the supplied action itself encounters an exception, then
            the returned<br>
            stage exceptionally completes with this exception unless
            this stage also<br>
            completed exceptionally."<br>
            <br>
            Huh?!<br>
            <br>
            So if the original stage completed with exception1 but the
            handler threw<br>
            exception2, which exception does the returned
            CompleteableFuture complete<br>
            with? The specification says what *won't* happen if the
            stage also completed<br>
            exceptionally, but it doesn't say what *will* happen. Please
            clarify :)<br>
            <br>
            Thanks,<br>
            Gili<br>
            <br>
            <br>
            <br>
            --<br>
            View this message in context: <a href="http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669.html" rel="nofollow" link="external" target="_blank">http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669.html</a><br>
            Sent from the JSR166 Concurrency mailing list archive at
            Nabble.com.<br>
            _______________________________________________<br>
            Concurrency-interest mailing list<br>
            </span><a href="http:///user/SendEmail.jtp?type=node&node=11671&i=1" rel="nofollow" link="external" target="_blank">[hidden
              email]</a><br>
            <a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" rel="nofollow" link="external" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a><br>
          </blockquote>
        </div>
      </div>
      <br>
      _______________________________________________
      <br>
      Concurrency-interest mailing list
      <br>
      <a href="http:///user/SendEmail.jtp?type=node&node=11671&i=2" rel="nofollow" link="external" target="_blank">[hidden email]</a>
      <br>
      <a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" rel="nofollow" link="external" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a><br>
      <br>
      <br>
      <hr color="#cccccc" noshade size="1">
      <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
        <div style="font-weight:bold">If you reply to this email, your
          message will be added to the discussion below:</div>
        <a href="http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669p11671.html" rel="nofollow" link="external" target="_blank">http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669p11671.html</a>
      </div>
      <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
        To unsubscribe from More Javadoc problems, <a rel="nofollow" link="external">click
          here</a>.<br>
        <a href="http://jsr166-concurrency.10961.n7.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" link="external" target="_blank">NAML</a> </div>
    </blockquote>
    <br>
  



        
        
        
<br><hr align="left" width="300">
View this message in context: <a href="http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669p11672.html" target="_blank">Re: More Javadoc problems</a><div class="HOEnZb"><div class="h5"><br>
Sent from the <a href="http://jsr166-concurrency.10961.n7.nabble.com/" target="_blank">JSR166 Concurrency mailing list archive</a> at Nabble.com.<br></div></div><br>_______________________________________________<br>
Concurrency-interest mailing list<br>
<a href="mailto:Concurrency-interest@cs.oswego.edu">Concurrency-interest@cs.oswego.edu</a><br>
<a href="http://cs.oswego.edu/mailman/listinfo/concurrency-interest" target="_blank">http://cs.oswego.edu/mailman/listinfo/concurrency-interest</a><br>
<br></blockquote></div></div>