[HTTPCLIENT-2124] NullPointerException in MinimalHttpClient.doExecute(HttpHost, ClassicHttpRequest, HttpContext)#261
Merged
garydgregory merged 2 commits intoapache:masterfrom Oct 25, 2020
Conversation
org.apache.hc.client5.http.impl.classic.MinimalHttpClient.doExecute(HttpHost, ClassicHttpRequest, HttpContext)
carterkozak
approved these changes
Oct 25, 2020
Contributor
carterkozak
left a comment
There was a problem hiding this comment.
Looks good to me, thanks!
michael-o
reviewed
Oct 25, 2020
Member
michael-o
left a comment
There was a problem hiding this comment.
Where is the NPE and why is there no try block in the second test?
Contributor
|
context is nullable where clientContext is not. The adaptClientContext line produces the clientContext from a nullable context. |
Contributor
|
As an aside, we’ve used https://github.com/uber/NullAway at work to avoid NPEs with compile time checks, but it can be painful to retrofit into large existing projects. |
Member
Author
|
On Sun, Oct 25, 2020 at 1:36 PM Carter Kozak ***@***.***> wrote:
As an aside, we’ve used https://github.com/uber/NullAway at work to avoid
NPEs with compile time checks, but it can be painful to retrofit into large
existing projects.
I found this one using SpotBugs which you can run as a Maven or Eclipse
plugin.
Gary
—
… You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#261 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJB6NZJSZIU3ZOEACBM6LLSMROZXANCNFSM4S6NOBNA>
.
|
michael-o
reviewed
Oct 25, 2020
...ting/src/test/java/org/apache/hc/client5/testing/sync/TestMinimalClientRequestExecution.java
Outdated
Show resolved
Hide resolved
org.apache.hc.client5.http.impl.classic.MinimalHttpClient.doExecute(HttpHost, ClassicHttpRequest, HttpContext) Use try-with-resources.
michael-o
approved these changes
Oct 25, 2020
asfgit
pushed a commit
that referenced
this pull request
Oct 25, 2020
…(HttpHost, ClassicHttpRequest, HttpContext) (#261)
asfgit
pushed a commit
that referenced
this pull request
Oct 26, 2020
…(HttpHost, ClassicHttpRequest, HttpContext) (#261)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NullPointerExceptioninorg.apache.hc.client5.http.impl.classic.MinimalHttpClient.doExecute(HttpHost, ClassicHttpRequest, HttpContext)