[concurrency-interest] More Javadoc problems

cowwoc cowwoc at bbs.darktech.org
Sat Dec 20 12:57:19 EST 2014

On 20/12/2014 10:39 AM, cowwoc wrote:
> I would actually love it for whenComplete() to behave like finally() 
> because if it did it would throw exception2.addSuppressed(exception1) 
> instead of exception1. Would it not? I think this would be a lot less 
> confusing and would prevent the kind of information loss we are 
> currently seeing.
> In any case, It would help if the Javadoc provided this information or 
> linked to a document that did. It would be great to read that 
> "whenComplete" is analogous to "finally", "handle" is analogous to 
> "catch" and so on. And also to read that one can use 
> CompletionException to wrap checked exceptions without having to do 
> any manual unwrapping later on.
> PS: When is the online Javadoc updated? If you look at 
> http://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html#whenComplete-java.util.function.BiConsumer- 
> you will notice that it doesn't contain any of this information. I'm 
> guessing that it corresponds to Java 8 update 0.
> Thanks,
> Gili

Now that I think about it: if the original Java8 specification did not 
mandate what should happen if the action throws an exception, does that 
mean we can change that specification now with minimal harm? Meaning, is 
there a chance we can mandate exception2.addSuppressed(exception1) be 

When was the Javadoc updated with the paragraph in question? Was it recent?


View this message in context: http://jsr166-concurrency.10961.n7.nabble.com/More-Javadoc-problems-tp11669p11688.html
Sent from the JSR166 Concurrency mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20141220/cbc7ebcd/attachment.html>

More information about the Concurrency-interest mailing list