diff options
author | Rob Daugherty <rd472p@att.com> | 2017-09-08 18:26:50 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-08 18:26:50 +0000 |
commit | 4185c36df2b316ae5bf8f522452b53cc8c770218 (patch) | |
tree | 360436e0ad520b8850b00238ebd7f4af81603a07 | |
parent | 62cd6aaaf74aa91ee0037c0e155c8e7284f07567 (diff) | |
parent | dfa2e48a4e87198eb323c223c6d6d18a1fa2464e (diff) |
Merge "sonar blocker issue fixes"
3 files changed, 25 insertions, 21 deletions
diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java index 4218ad8d2f..90d1180d77 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/BpelRestClient.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * OPENECOMP - MSO + * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -176,7 +176,7 @@ public class BpelRestClient { try { s.add(Integer.parseInt(t)); } catch (NumberFormatException x) { - // ignore + LOGGER.debug("Exception while parsing", x); } } this.retryList = s; @@ -227,7 +227,7 @@ public class BpelRestClient { try { Thread.sleep(sleepinterval * 1000L); } catch (InterruptedException e) { - // ignore + LOGGER.debug("Exception while Thread sleep", e); } } } @@ -240,7 +240,7 @@ public class BpelRestClient { LOGGER.debug("Content is: "+toBpelStr); //Client 4.3+ - CloseableHttpClient client = HttpClients.createDefault(); + CloseableHttpClient client = null; //POST HttpPost post = new HttpPost(bpelUrl); @@ -262,6 +262,7 @@ public class BpelRestClient { //Client 4.3+ //Execute & GetResponse try { + client = HttpClients.createDefault(); CloseableHttpResponse response = client.execute(post); if (response != null) { lastResponseCode = response.getStatusLine().getStatusCode(); @@ -277,10 +278,12 @@ public class BpelRestClient { lastResponseCode = 900; lastResponse = ""; } finally { - try { - client.close(); - } catch (IOException e) { - // ignore + if(client != null){ + try { + client.close(); + } catch (IOException e) { + LOGGER.debug("Exception while closing client", e); + } } } LOGGER.debug("Response code from BPEL server: "+lastResponseCode); diff --git a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterAsyncImpl.java b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterAsyncImpl.java index d697182c90..0878bc54c9 100644 --- a/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterAsyncImpl.java +++ b/adapters/mso-network-adapter/src/main/java/org/openecomp/mso/adapters/network/MsoNetworkAdapterAsyncImpl.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * OPENECOMP - MSO + * ONAP - SO * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ @@ -600,8 +600,9 @@ public class MsoNetworkAdapterAsyncImpl implements MsoNetworkAdapterAsync { LOGGER.error (MessageEnum.RA_INIT_NOTIF_EXC, "", "", MsoLogger.ErrorCode.DataError, "Exception - init notification", e1); } - LOGGER.debug ("Notification Endpoint URL: " + epUrl.toExternalForm ()); - + if(null != epUrl) { + LOGGER.debug ("Notification Endpoint URL: " + epUrl.toExternalForm ()); + } bp.getRequestContext ().put (BindingProvider.ENDPOINT_ADDRESS_PROPERTY, epUrl.toExternalForm ()); // authentication diff --git a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java index 5ef77eec40..1a4c16dc7a 100644 --- a/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java +++ b/bpmn/MSOURN-plugin/src/main/java/org/openecomp/camunda/bpmn/plugin/urnmap/resources/URNResource.java @@ -82,21 +82,21 @@ public class URNResource extends AbstractCockpitPluginResource{ } catch (Exception e)
{
- msoLogger.debug("Exception in getUrnDataMap " + e);
+ msoLogger.debug("Exception in getUrnDataMap ", e);
} finally {
if(psData != null){
try {
psData.close();
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: " + e);
+ msoLogger.debug("Exception while closing the PreparedStatement: ", e);
}
}
if(conn != null){
try {
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: " + e);
+ msoLogger.debug("Exception while closing the connection: ", e);
}
}
}
@@ -143,7 +143,7 @@ public class URNResource extends AbstractCockpitPluginResource{ } catch (Exception e)
{
- msoLogger.debug("Exception in DBConnection " + e);
+ msoLogger.debug("Exception in DBConnection ", e);
}
return conn;
@@ -183,21 +183,21 @@ public class URNResource extends AbstractCockpitPluginResource{ } catch (Exception e)
{
- msoLogger.debug("Exception in insertNewRow " + e);
+ msoLogger.debug("Exception in insertNewRow ", e);
}finally {
if(psData != null){
try {
psData.close();
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: " + e);
+ msoLogger.debug("Exception while closing the PreparedStatement: ", e);
}
}
if(conn != null){
try {
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: " + e);
+ msoLogger.debug("Exception while closing the connection: ", e);
}
}
}
@@ -219,21 +219,21 @@ public class URNResource extends AbstractCockpitPluginResource{ } catch (Exception e)
{
- msoLogger.debug("Exception in PersistData " + e);
+ msoLogger.debug("Exception in PersistData ", e);
}finally {
if(psData != null){
try {
psData.close();
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the PreparedStatement: " + e);
+ msoLogger.debug("Exception while closing the PreparedStatement: ", e);
}
}
if(conn != null){
try {
conn.close();
} catch (SQLException e) {
- msoLogger.debug("Exception while closing the connection: " + e);
+ msoLogger.debug("Exception while closing the connection: ", e);
}
}
}
|