Siqi Li created HTTPCLIENT-2059:
-----------------------------------

             Summary: MinimalHttpAsyncClient does not allow null HttpContext
                 Key: HTTPCLIENT-2059
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-2059
             Project: HttpComponents HttpClient
          Issue Type: Improvement
          Components: HttpClient (async)
    Affects Versions: 5.0
            Reporter: Siqi Li


In `HttpAsyncClient.execute`, the Javadoc says `@param context HTTP context. 
Optional and may be \{@code null}.`

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);
    }
  }{code}
 



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to