aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core
diff options
context:
space:
mode:
authorDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-10 12:06:06 +0530
committerDriptaroop Das <driptaroop.das@in.ibm.com>2019-01-10 12:06:20 +0530
commitd3f777567f46e72dcad391cb8cfc724d3d8c7588 (patch)
tree038f50d25f1cc86c4cf151a733a6ce46430231bc /aai-core
parent1dd67efcaf40c5b4278ad8594b78f63a838514ca (diff)
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 <driptaroop.das@in.ibm.com>
Diffstat (limited to 'aai-core')
-rw-r--r--aai-core/src/main/java/org/onap/aai/auth/AAIAuthCore.java8
1 files 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);
}
}