You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Michael Osipov (Jira)" <ji...@apache.org> on 2020/03/06 09:16:00 UTC

[jira] [Commented] (HTTPCLIENT-2059) MinimalHttpAsyncClient does not allow null HttpContext

    [ https://issues.apache.org/jira/browse/HTTPCLIENT-2059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17053193#comment-17053193 ] 

Michael Osipov commented on HTTPCLIENT-2059:
--------------------------------------------

Show us the NPE.

> MinimalHttpAsyncClient does not allow null HttpContext
> ------------------------------------------------------
>
>                 Key: HTTPCLIENT-2059
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2059
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient (async)
>    Affects Versions: 5.0
>            Reporter: Siqi Li
>            Priority: Minor
>
> In HttpAsyncClient.execute, the Javadoc says:
> {code:java}
> @param context HTTP context. Optional and may be {@code null}.{code}
> However, the following code will cause a NullPointerException because the input HttpContext is null:
> {code:java}
>   public static void main(String[] args) throws Exception {
>     try (MinimalHttpAsyncClient client = HttpAsyncClients.createMinimal()) {
>       client.start();
>       client.execute(SimpleRequestProducer.create(SimpleHttpRequests.get("https://example.com")),
>           SimpleResponseConsumer.create(), null, null, null).get();
>     }
>   }{code}
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org