Fix for code Vulnerability,reported by Sonar 43/78043/3
authorJegadeesh Babu <jegabab1@in.ibm.com>
Thu, 7 Feb 2019 10:56:42 +0000 (16:26 +0530)
committerJegadeesh Babu <jegabab1@in.ibm.com>
Tue, 12 Feb 2019 13:01:34 +0000 (13:01 +0000)
Removed and printStackTrace and added logger

Issue-ID: MUSIC-314
Change-Id: Ieeb33d6e58ec469c6fb540d943bae97b703ebbda
Signed-off-by: Jegadeesh Babu <jegabab1@in.ibm.com>
src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java

index 93c4446..3e962a0 100644 (file)
@@ -3,6 +3,8 @@
  * org.onap.music
  * ===================================================================
  *  Copyright (c) 2017 AT&T Intellectual Property
+ *  
+ *  Modifications Copyright (C) 2019 IBM.
  * ===================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -65,9 +67,7 @@ public class MusicHealthCheck {
                     try {
                         result = getAdminKeySpace(consistency);
                     } catch (MusicServiceException e1) {
-                        // TODO Auto-generated catch block
-                        logger.error("Error", e);
-                        e1.printStackTrace();
+                      logger.error(EELFLoggerDelegate.errorLogger, e1.getMessage(),AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN);
                     }
             } else {
                 logger.error("Error", e);
@@ -106,9 +106,7 @@ public class MusicHealthCheck {
         try {
             rs = MusicCore.nonKeyRelatedPut(pQuery, ConsistencyLevel.ONE.toString());
         } catch (MusicServiceException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-            logger.error("Error", e);
+            logger.error(EELFLoggerDelegate.errorLogger, e.getMessage(),AppMessages.UNKNOWNERROR, ErrorSeverity.ERROR, ErrorTypes.UNKNOWN);
         }
         if(rs != null && rs.getResult().toLowerCase().contains("success"))
             return true;