From d3f777567f46e72dcad391cb8cfc724d3d8c7588 Mon Sep 17 00:00:00 2001 From: Driptaroop Das Date: Thu, 10 Jan 2019 12:06:06 +0530 Subject: AAIAuthCore-replace duplicate literal by constant Sonar Fix (AAIAuthCore.java - Define a constant instead of duplicating this literal "AAI_4001" 3 times.) Issue-ID: AAI-2065 Change-Id: Ic9c343f814dc220fe118b21ae08f29a65a337da7 Signed-off-by: Driptaroop Das --- aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java b/aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java index 1572ec72..5097ef41 100644 --- a/aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java +++ b/aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java @@ -53,6 +53,8 @@ public final class AAIAuthCore { private static final EELFLogger LOGGER = EELFManager.getInstance().getLogger(AAIAuthCore.class); + private static final String ERROR_CODE_AAI_4001 = "AAI_4001"; + private String globalAuthFileName = AAIConstants.AAI_AUTH_CONFIG_FILENAME; private final Pattern AUTH_POLICY_PATTERN; @@ -161,11 +163,11 @@ public final class AAIAuthCore { } } } catch (FileNotFoundException e) { - ErrorLogHelper.logError("AAI_4001", globalAuthFileName + ". Exception: " + e); + ErrorLogHelper.logError(ERROR_CODE_AAI_4001, globalAuthFileName + ". Exception: " + e); } catch (JsonProcessingException e) { - ErrorLogHelper.logError("AAI_4001", globalAuthFileName + ". Not valid JSON: " + e); + ErrorLogHelper.logError(ERROR_CODE_AAI_4001, globalAuthFileName + ". Not valid JSON: " + e); } catch (Exception e) { - ErrorLogHelper.logError("AAI_4001", globalAuthFileName + ". Exception caught: " + e); + ErrorLogHelper.logError(ERROR_CODE_AAI_4001, globalAuthFileName + ". Exception caught: " + e); } } -- cgit 1.2.3-korg