From 2691cfe68a314ab782f29c5b09d1efeb06aa484a Mon Sep 17 00:00:00 2001 From: Driptaroop Das Date: Fri, 1 Feb 2019 13:04:42 +0530 Subject: Sonar Fixes - MusicAuthentication.java Sonar Fixes - MusicAuthentication.java Issue-ID: MUSIC-304 Change-Id: I70518240f7c736b5301d6a1104c131328643391b Signed-off-by: Driptaroop Das --- .../java/org/onap/music/authentication/MusicAuthentication.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/main/java/org') diff --git a/src/main/java/org/onap/music/authentication/MusicAuthentication.java b/src/main/java/org/onap/music/authentication/MusicAuthentication.java index 0471e309..1d845b3c 100644 --- a/src/main/java/org/onap/music/authentication/MusicAuthentication.java +++ b/src/main/java/org/onap/music/authentication/MusicAuthentication.java @@ -37,7 +37,6 @@ import org.onap.music.exceptions.MusicServiceException; import org.onap.music.main.CachingUtil; import org.onap.music.main.MusicCore; import org.onap.music.main.MusicUtil; -import org.onap.music.service.impl.MusicZKCore; import com.datastax.driver.core.DataType; import com.datastax.driver.core.Row; @@ -76,6 +75,7 @@ public class MusicAuthentication { try { isAAFApp= CachingUtil.isAAFApplication(nameSpace); } catch(MusicServiceException e) { + logger.error(e.getErrorMessage(), e); resultMap.put("Exception", e.getMessage()); return resultMap; } @@ -84,7 +84,7 @@ public class MusicAuthentication { + " is correct and Application is onboarded."); return resultMap; } - boolean isAAF = Boolean.valueOf(isAAFApp); + boolean isAAF = Boolean.parseBoolean(isAAFApp); if (userId == null || password == null) { logger.error(EELFLoggerDelegate.errorLogger,"", AppMessages.MISSINGINFO ,ErrorSeverity.WARN, ErrorTypes.AUTHENTICATIONERROR); logger.error(EELFLoggerDelegate.errorLogger,"One or more required headers is missing. userId: " + userId @@ -141,7 +141,7 @@ public class MusicAuthentication { uuid = rs.getUUID("uuid").toString(); resultMap.put("uuid", "existing"); } catch (Exception e) { - logger.info(EELFLoggerDelegate.applicationLogger,"No UUID found in DB. So creating new UUID."); + logger.error(EELFLoggerDelegate.applicationLogger,"No UUID found in DB. So creating new UUID."); uuid = CachingUtil.generateUUID(); resultMap.put("uuid", "new"); } @@ -154,8 +154,6 @@ public class MusicAuthentication { public static boolean authenticateAdmin(String id,String password) { - String a = MusicUtil.getAdminId(); - String b = MusicUtil.getAdminPass(); return (id.equals(MusicUtil.getAdminId()) && password.equals(MusicUtil.getAdminPass())); } -- cgit 1.2.3-korg