From d1bc89d22c15871c22725f0f0336f8e53d5b3660 Mon Sep 17 00:00:00 2001 From: Jegadeesh Babu Date: Thu, 7 Feb 2019 16:26:42 +0530 Subject: Fix for code Vulnerability,reported by Sonar Removed and printStackTrace and added logger Issue-ID: MUSIC-314 Change-Id: Ieeb33d6e58ec469c6fb540d943bae97b703ebbda Signed-off-by: Jegadeesh Babu --- .../java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/main/java') diff --git a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java index 93c44468..3e962a02 100644 --- a/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java +++ b/src/main/java/org/onap/music/eelf/healthcheck/MusicHealthCheck.java @@ -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; -- cgit 1.2.3-korg