From a8b497dacd36b86e0accf764a0290507923be7df Mon Sep 17 00:00:00 2001 From: rama-huawei Date: Wed, 20 Sep 2017 12:04:57 +0530 Subject: Fix for Sonar major issues Change includes: 1) Add the "@Override" annotation for overriding methods 2) Move the string literal on the left side of the actual string comparison. Issue-ID: POLICY-239 Change-Id: I83b0cf41d630ef80f08eda35c9c37ae591332f74 Signed-off-by: rama-huawei --- PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java | 1 + .../src/main/java/org/onap/policy/api/DeletePolicyCondition.java | 1 + PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java | 1 + PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java | 1 + .../src/main/java/org/onap/policy/api/PolicyConfigStatus.java | 3 ++- .../src/main/java/org/onap/policy/api/PolicyConfigType.java | 1 + PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java | 1 + 7 files changed, 8 insertions(+), 1 deletion(-) (limited to 'PolicyEngineAPI') diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java index 8cfa51212..0a4621902 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java @@ -62,6 +62,7 @@ public enum AttributeType { * Returns the String format of Type for this AttributeType * @return the String of the Type for this AttributeType */ + @Override public String toString() { return this.name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyCondition.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyCondition.java index 4001d3fa6..117ac716e 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyCondition.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyCondition.java @@ -49,6 +49,7 @@ public enum DeletePolicyCondition { * Returns the String format of delete condition for this Policy * @return the String of the delete condition for this Policy */ + @Override public String toString(){ return this.name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java index 5ac6d5ed8..499295d65 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java @@ -83,6 +83,7 @@ public enum DictionaryType{ * Returns the String format of Type for this PolicyClass * @return the String of the Type for this PolicyClass */ + @Override public String toString() { return this.name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java index 5132a44be..6a648e8e6 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java @@ -52,6 +52,7 @@ public enum PolicyClass { * Returns the String format of Type for this PolicyClass * @return the String of the Type for this PolicyClass */ + @Override public String toString() { return this.name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigStatus.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigStatus.java index 23291c9b9..cee156786 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigStatus.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigStatus.java @@ -52,7 +52,7 @@ public enum PolicyConfigStatus { * if no match is found */ public static PolicyConfigStatus getStatus(String configStatus) { - if(configStatus.equalsIgnoreCase("retrieved")) { + if("retrieved".equalsIgnoreCase(configStatus)) { return CONFIG_RETRIEVED; }else { return CONFIG_NOT_FOUND; @@ -64,6 +64,7 @@ public enum PolicyConfigStatus { * * @return the String name for this PolicyConfigStatus */ + @Override public String toString(){ return this.name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigType.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigType.java index 59fd42733..2fb5d96db 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigType.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigType.java @@ -73,6 +73,7 @@ public enum PolicyConfigType{ * Returns the String format of Type for this PolicyClass * @return the String of the Type for this PolicyClass */ + @Override public String toString() { return name; } diff --git a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java index b5fdc1e01..6bae84cc7 100644 --- a/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java +++ b/PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java @@ -53,6 +53,7 @@ public enum PolicyDecision { * * @return the String name for this PolicyDecision */ + @Override public String toString(){ return this.name; } -- cgit 1.2.3-korg