Not sure that instream can be null, but assuming it can, there's no point entering the try block if it's null. This avoids NPE warning
git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1206734 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6921a32fa6
commit
8f91869343
|
@ -139,16 +139,16 @@ public class TestHttpClient4 implements TestHttpAgent {
|
|||
HttpEntity entity = response.getEntity();
|
||||
if (entity != null) {
|
||||
InputStream instream = entity.getContent();
|
||||
try {
|
||||
contentLen = 0;
|
||||
if (instream != null) {
|
||||
contentLen = 0;
|
||||
if (instream != null) {
|
||||
try {
|
||||
int l = 0;
|
||||
while ((l = instream.read(buffer)) != -1) {
|
||||
contentLen += l;
|
||||
}
|
||||
} finally {
|
||||
instream.close();
|
||||
}
|
||||
} finally {
|
||||
instream.close();
|
||||
}
|
||||
}
|
||||
if (response.getStatusLine().getStatusCode() == 200) {
|
||||
|
|
Loading…
Reference in New Issue