hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1794452 - /httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
Date Mon, 08 May 2017 20:31:36 GMT
Author: ggregory
Date: Mon May  8 20:31:36 2017
New Revision: 1794452

URL: http://svn.apache.org/viewvc?rev=1794452&view=rev
Log:
Add missing close() call.

Modified:
    httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java

Modified: httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java?rev=1794452&r1=1794451&r2=1794452&view=diff
==============================================================================
--- httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
(original)
+++ httpcomponents/httpclient/branches/4.5.x/httpclient-win/src/test/java/org/apache/http/impl/auth/win/TestWindowsNegotiateScheme.java
Mon May  8 20:31:36 2017
@@ -110,14 +110,17 @@ public class TestWindowsNegotiateScheme
         final CloseableHttpClient customClient = HttpClientBuilder.create()
                 .setDefaultCredentialsProvider(credsProvider)
                 .setDefaultAuthSchemeRegistry(authSchemeRegistry).build();
-
-        final HttpHost target = start();
-        final HttpGet httpGet = new HttpGet("/");
-        final CloseableHttpResponse response = customClient.execute(target, httpGet);
         try {
-            EntityUtils.consume(response.getEntity());
-        } finally {
-            response.close();
+            final HttpHost target = start();
+            final HttpGet httpGet = new HttpGet("/");
+            final CloseableHttpResponse response = customClient.execute(target, httpGet);
+            try {
+                EntityUtils.consume(response.getEntity());
+            } finally {
+                response.close();
+            }
+        }finally {
+            customClient.close();
         }
     }
 



Mime
View raw message