Fix sonar issue in asdc-controller 14/89214/2
authorParshad Patel <pars.patel@samsung.com>
Tue, 4 Jun 2019 07:59:41 +0000 (16:59 +0900)
committerParshad Patel <pars.patel@samsung.com>
Tue, 18 Jun 2019 11:14:11 +0000 (20:14 +0900)
Fix Either log or rethrow this exception

Issue-ID: SO-1841
Change-Id: I2a333d94b040b7bf4ac646fc6f729874eb0fe054
Signed-off-by: Parshad Patel <pars.patel@samsung.com>
asdc-controller/src/main/java/org/onap/so/asdc/activity/ActivitySpecsActions.java
asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCConfiguration.java

index afa6ccc..c37eccf 100644 (file)
@@ -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;
index 60abdc3..639a96e 100644 (file)
@@ -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<String> 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);
     }