From 17a5fbcb3a2b5e2fb9135a19000f305e030325b5 Mon Sep 17 00:00:00 2001 From: Parshad Patel Date: Tue, 4 Jun 2019 16:59:41 +0900 Subject: Fix sonar issue in asdc-controller Fix Either log or rethrow this exception Issue-ID: SO-1841 Change-Id: I2a333d94b040b7bf4ac646fc6f729874eb0fe054 Signed-off-by: Parshad Patel --- .../org/onap/so/asdc/activity/ActivitySpecsActions.java | 4 ++-- .../java/org/onap/so/asdc/client/ASDCConfiguration.java | 13 +++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'asdc-controller') diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java index afa6ccced1..c37eccf594 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java @@ -86,7 +86,7 @@ public class ActivitySpecsActions { } } } catch (Exception e) { - logger.warn(LoggingAnchor.TWO, "Exception creating activitySpec", e.getMessage()); + logger.warn(LoggingAnchor.TWO, "Exception creating activitySpec", e); } return activitySpecId; @@ -120,7 +120,7 @@ public class ActivitySpecsActions { } } catch (Exception e) { - logger.warn(LoggingAnchor.TWO, "Exception certifying activitySpec", e.getMessage()); + logger.warn(LoggingAnchor.TWO, "Exception certifying activitySpec", e); } return certificationResult; diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java index 60abdc33ef..639a96eab6 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java @@ -22,7 +22,6 @@ package org.onap.so.asdc.client; - import java.security.GeneralSecurityException; import java.util.Arrays; import java.util.Collections; @@ -40,11 +39,11 @@ import org.springframework.stereotype.Component; public class ASDCConfiguration implements IConfiguration { // SHell command to obtain the same encryption, 128 bits key, key must be HEX - // echo -n "This is a test string" | openssl aes-128-ecb -e -K 546573746F736973546573746F736973 -nosalt | xxd + // echo -n "This is a test string" | openssl aes-128-ecb -e -K 546573746F736973546573746F736973 + // -nosalt | xxd private static Logger logger = LoggerFactory.getLogger(ASDCConfiguration.class); - private String asdcControllerName; public static final String HEAT = "HEAT"; @@ -74,7 +73,6 @@ public class ASDCConfiguration implements IConfiguration { @Value("${mso.asdc-connections.asdc-controller1.messageBusAddress}") private String[] messageBusAddress; - public void setAsdcControllerName(String asdcControllerName) { this.asdcControllerName = asdcControllerName; } @@ -96,15 +94,12 @@ public class ASDCConfiguration implements IConfiguration { } else { return Collections.emptyList(); } - - } public String getAsdcControllerName() { return asdcControllerName; } - @Override public String getConsumerGroup() { return getPropertyOrNull("mso.asdc-connections.asdc-controller1.consumerGroup"); @@ -172,6 +167,7 @@ public class ASDCConfiguration implements IConfiguration { try { return Boolean.valueOf(config); } catch (Exception e) { + logger.warn("Exception while getting boolean property with default property", e); return defaultValue; } } @@ -194,7 +190,8 @@ public class ASDCConfiguration implements IConfiguration { @Override public List getRelevantArtifactTypes() { - // DO not return the Static List SUPPORTED_ARTIFACT_TYPES_LIST because the ASDC Client will try to modify it !!! + // DO not return the Static List SUPPORTED_ARTIFACT_TYPES_LIST because the ASDC Client will + // try to modify it !!! return Arrays.asList(SUPPORTED_ARTIFACT_TYPES); } -- cgit 1.2.3-korg