commit | 811db4c39abb769a14c9b5ab1093b764c8b42a50 | [log] [tgz] |
---|---|---|
author | amshegokar <as00500801@techmahindra.com> | Wed Sep 20 14:18:03 2017 +0530 |
committer | Skip Wonnell <skip@att.com> | Wed Sep 20 08:20:34 2017 -0500 |
tree | 24af7a758f974d35d326c4b80c8a062ef51ec22f | |
parent | b59ab6b65a4f81464a970e579107d0828f78aadc [diff] |
Sonar Blocker For rest healthcheck Adapter-bundle Change-Id: Ic499d7af6c90cd692e8362ba4f7d2f5d62d48422 Issue-ID: APPC-216 Signed-off-by: Shubhada Ramkrishna Vaze <SV00449682@TechMahindra.com> Signed-off-by: Skip Wonnell <skip@att.com>
diff --git a/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/main/java/org/openecomp/appc/adapter/restHealthcheck/impl/RestHealthcheckAdapterImpl.java b/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/main/java/org/openecomp/appc/adapter/restHealthcheck/impl/RestHealthcheckAdapterImpl.java index 094ef3e..6cf2eaf 100644 --- a/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/main/java/org/openecomp/appc/adapter/restHealthcheck/impl/RestHealthcheckAdapterImpl.java +++ b/appc-adapters/appc-rest-healthcheck-adapter/appc-rest-healthcheck-adapter-bundle/src/main/java/org/openecomp/appc/adapter/restHealthcheck/impl/RestHealthcheckAdapterImpl.java
@@ -32,6 +32,7 @@ import java.util.Properties; import java.util.Set; import java.util.regex.Pattern; +import org.apache.http.impl.client.CloseableHttpClient; import org.openecomp.appc.Constants; import org.openecomp.appc.adapter.restHealthcheck.RestHealthcheckAdapter; @@ -258,9 +259,8 @@ RequestContext rc = new RequestContext(ctx); rc.isAlive(); - try { + try(CloseableHttpClient httpClient = HttpClients.createDefault()) { HttpGet httpGet = new HttpGet(tUrl); - HttpClient httpClient = HttpClients.createDefault(); HttpResponse response = null; response = httpClient.execute(httpGet); int responseCode=response.getStatusLine().getStatusCode();