RFR: 8331987: Enhance stacktrace clarity for CompletableFuture CancellationException [v2]

Viktor Klang vklang at openjdk.org
Mon May 13 23:59:17 UTC 2024


On Mon, 13 May 2024 18:16:55 GMT, Doug Lea <dl at openjdk.org> wrote:

>> src/java.base/share/classes/java/util/concurrent/CompletableFuture.java line 392:
>> 
>>> 390:                 return null;
>>> 391:             if (x instanceof CancellationException)
>>> 392:                 throw new CancellationException("", (CancellationException)x);
>> 
>> One option here would be to put "CompletableFuture.get()" or "get()" as a message.
>
> Given the serviceability motivation, the overkill of adding "get" and "join" strings seems reasonable.

@DougLea Yeah, I think that's fair enough. I pushed a commit which allows for customization of the details message.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/19219#discussion_r1599221161


More information about the core-libs-dev mailing list