Skip to content

ListenableFuture#addListener with null executor throws NPE #1369

@joedj

Description

@joedj

ListenableFuture#addListener javadoc says:

* Executor can be <code>null</code>, in that case executor will be executed
* in the thread where completion happens.

However, this doesn't work with the NettyResponseFuture implementation:

java.lang.NullPointerException
at java.util.concurrent.CompletableFuture.screenExecutor(CompletableFuture.java:415)
at java.util.concurrent.CompletableFuture.whenCompleteAsync(CompletableFuture.java:2142)
at org.asynchttpclient.netty.NettyResponseFuture.addListener(NettyResponseFuture.java:257)

I'm happy to submit a pull request for this issue, if you can indicate how you want it fixed (i.e. update the documentation to reflect current behavour, or change behaviour to match documentation).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions