@@ -218,7 +218,7 @@ public long getKeepAliveDuration(final HttpResponse myResponse, final HttpContex
218218 final HeaderElement he = it .nextElement ();
219219 final String param = he .getName ();
220220 final String value = he .getValue ();
221- if (value != null && param .equalsIgnoreCase ("timeout" )) {
221+ if (( value != null ) && param .equalsIgnoreCase ("timeout" )) {
222222 return Long .parseLong (value ) * 1000 ;
223223 }
224224 }
@@ -251,9 +251,9 @@ public final void givenBasicHttpClientConnManager_whenConnectionReuse_thenNoExce
251251 basicConnManager .connect (conn , route , 1000 , context );
252252 basicConnManager .routeComplete (conn , route , context );
253253 final HttpRequestExecutor exeRequest = new HttpRequestExecutor ();
254- context .setTargetHost ((new HttpHost ("www.baeldung.com " , 80 )));
254+ context .setTargetHost ((new HttpHost ("http://httpbin.org " , 80 )));
255255
256- final HttpGet get = new HttpGet ("http://www.baeldung.com " );
256+ final HttpGet get = new HttpGet ("http://httpbin.org " );
257257 exeRequest .execute (get , conn , context );
258258 conn .isResponseAvailable (1000 );
259259 basicConnManager .releaseConnection (conn , null , 1 , TimeUnit .SECONDS );
@@ -282,8 +282,9 @@ public final void givenBasicHttpClientConnManager_whenConnectionReuse_thenNoExce
282282 for (final MultiHttpClientConnThread thread : threads ) {
283283 thread .join (10000 );
284284 countConnMade ++;
285- if (countConnMade == 0 )
285+ if (countConnMade == 0 ) {
286286 assertTrue (thread .getLeasedConn () == 5 );
287+ }
287288 }
288289 }
289290
@@ -356,7 +357,7 @@ public final void whenHttpClientChecksStaleConns_thenNoExceptions() {
356357 // @Ignore
357358 // 8.2 ARTICLE VERSION
358359 public final void whenCustomizedIdleConnMonitor_thenNoExceptions () throws InterruptedException , IOException {
359- final HttpGet get = new HttpGet ("http://google.com" );
360+ new HttpGet ("http://google.com" );
360361 poolingConnManager = new PoolingHttpClientConnectionManager ();
361362 client = HttpClients .custom ().setConnectionManager (poolingConnManager ).build ();
362363 final IdleConnectionMonitorThread staleMonitor = new IdleConnectionMonitorThread (poolingConnManager );
0 commit comments