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:
Sebastian Bazley 2011-11-27 15:28:28 +00:00
parent 6921a32fa6
commit 8f91869343
1 changed files with 5 additions and 5 deletions

View File

@ -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) {