Fix remaining SOnar

Resolve remaining sonar issues reported in Critical and Blocker

Change-Id: Id80bf15c78e93a454f2446cb563f5c29a186b3d4
Issue-ID: CLAMP-74
Signed-off-by: Determe, Sebastien (sd378r) <sd378r@intl.att.com>
diff --git a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
index e01a68f..9571535 100644
--- a/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
+++ b/src/main/java/org/onap/clamp/clds/client/req/policy/PolicyClient.java
@@ -62,21 +62,21 @@
  * Policy utility methods - specifically, send the policy.
  */
 public class PolicyClient {
-    protected static final String     POLICY_PREFIX_BASE            = "Config_";
-    protected static final String     POLICY_PREFIX_BRMS_PARAM      = "Config_BRMS_Param_";
-    protected static final String     POLICY_PREFIX_MICROSERVICE    = "Config_MS_";
-    protected static final String     LOG_POLICY_PREFIX             = "Response is ";
-    protected static final EELFLogger logger                        = EELFManager.getInstance()
-            .getLogger(PolicyClient.class);
-    protected static final EELFLogger metricsLogger                 = EELFManager.getInstance().getMetricsLogger();
-    protected static final String     POLICY_MSTYPE_PROPERTY_NAME   = "policy.ms.type";
-    protected static final String     POLICY_ONAPNAME_PROPERTY_NAME = "policy.onap.name";
+
+    protected static final String POLICY_PREFIX_BASE = "Config_";
+    protected static final String POLICY_PREFIX_BRMS_PARAM = "Config_BRMS_Param_";
+    protected static final String POLICY_PREFIX_MICROSERVICE = "Config_MS_";
+    protected static final String LOG_POLICY_PREFIX = "Response is ";
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(PolicyClient.class);
+    protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
+    protected static final String POLICY_MSTYPE_PROPERTY_NAME = "policy.ms.type";
+    protected static final String POLICY_ONAPNAME_PROPERTY_NAME = "policy.onap.name";
     @Value("${org.onap.clamp.config.files.cldsPolicyConfig:'classpath:/clds/clds-policy-config.properties'}")
-    protected String                  cldsPolicyConfigFile;
+    protected String cldsPolicyConfigFile;
     @Autowired
-    protected ApplicationContext      appContext;
+    protected ApplicationContext appContext;
     @Autowired
-    protected RefProp                 refProp;
+    protected RefProp refProp;
 
     /**
      * Perform BRMS policy type.
@@ -88,7 +88,6 @@
      * @param policyRequestUuid
      *            PolicyRequest UUID
      * @return The response message of policy
-     * 
      */
     public String sendBrmsPolicy(Map<AttributeType, Map<String, String>> attributes, ModelProperties prop,
             String policyRequestUuid) {
@@ -331,7 +330,7 @@
             logger.info("Policy versions.size()=" + versions.size());
         } catch (PolicyConfigException e) {
             // just print warning - if no policy version found
-            logger.warn("warning: policy not found...policy name - " + policyName, e.getMessage());
+            logger.warn("policy not found...policy name - " + policyName, e);
         }
         return versions;
     }
@@ -393,7 +392,6 @@
      *
      * @param prop
      *            The ModelProperties
-     *
      * @return The response message from policy
      */
     protected String deletePolicy(ModelProperties prop, String policyType) {
diff --git a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
index 2c052c1..625aea5 100644
--- a/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
+++ b/src/main/java/org/onap/clamp/clds/dao/CldsDao.java
@@ -54,20 +54,21 @@
  */
 @Repository("cldsDao")
 public class CldsDao {
-    protected static final EELFLogger logger        = EELFManager.getInstance().getLogger(CldsDao.class);
+
+    protected static final EELFLogger logger = EELFManager.getInstance().getLogger(CldsDao.class);
     protected static final EELFLogger metricsLogger = EELFManager.getInstance().getMetricsLogger();
-    private JdbcTemplate              jdbcTemplateObject;
-    private SimpleJdbcCall            procGetModel;
-    private SimpleJdbcCall            procGetModelTemplate;
-    private SimpleJdbcCall            procSetModel;
-    private SimpleJdbcCall            procInsEvent;
-    private SimpleJdbcCall            procUpdEvent;
-    private SimpleJdbcCall            procSetTemplate;
-    private SimpleJdbcCall            procGetTemplate;
-    private SimpleJdbcCall            procDelAllModelInstances;
-    private SimpleJdbcCall            procInsModelInstance;
-    private SimpleJdbcCall            procDelModelInstance;
-    private static final String       HEALTHCHECK   = "Select 1";
+    private JdbcTemplate jdbcTemplateObject;
+    private SimpleJdbcCall procGetModel;
+    private SimpleJdbcCall procGetModelTemplate;
+    private SimpleJdbcCall procSetModel;
+    private SimpleJdbcCall procInsEvent;
+    private SimpleJdbcCall procUpdEvent;
+    private SimpleJdbcCall procSetTemplate;
+    private SimpleJdbcCall procGetTemplate;
+    private SimpleJdbcCall procDelAllModelInstances;
+    private SimpleJdbcCall procInsModelInstance;
+    private SimpleJdbcCall procDelModelInstance;
+    private static final String HEALTHCHECK = "Select 1";
 
     /**
      * Log message when instantiating
@@ -421,11 +422,12 @@
         List<CldsServiceData> cldsServiceDataList = new ArrayList<>();
         try {
             String getCldsServiceSQL = "SELECT * , TIMESTAMPDIFF(SECOND, timestamp, CURRENT_TIMESTAMP()) FROM clds_service_cache where invariant_service_id  = ? ";
-            cldsServiceData = jdbcTemplateObject.queryForObject(getCldsServiceSQL, new Object[] { invariantUUID },
-                    new CldsServiceDataMapper());
+            cldsServiceData = jdbcTemplateObject.queryForObject(getCldsServiceSQL, new Object[] {
+                    invariantUUID
+            }, new CldsServiceDataMapper());
             logger.info("value of cldsServiceDataList: {}", cldsServiceDataList);
         } catch (EmptyResultDataAccessException e) {
-            logger.info("cache row not found for invariantUUID: {}", invariantUUID);
+            logger.warn("cache row not found for invariantUUID: " + invariantUUID, e);
         }
         return cldsServiceData;
     }
diff --git a/src/main/java/org/onap/clamp/clds/service/CldsUser.java b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
index db8a24f..af39991 100644
--- a/src/main/java/org/onap/clamp/clds/service/CldsUser.java
+++ b/src/main/java/org/onap/clamp/clds/service/CldsUser.java
@@ -26,8 +26,9 @@
 import java.util.Arrays;
 
 public class CldsUser {
-    private String                    user;
-    private String                    password;
+
+    private String user;
+    private String password;
     private SecureServicePermission[] permissions;
 
     /**
@@ -68,6 +69,7 @@
     }
 
     public String[] getPermissionsString() {
+        // NOSONAR
         return Arrays.stream(getPermissions()).map(SecureServicePermission::getKey).toArray(String[]::new);
     }