diff options
author | rama-huawei <rama.subba.reddy.s@huawei.com> | 2017-09-20 12:04:57 +0530 |
---|---|---|
committer | Rama SubbaReddy <rama.subba.reddy.s@huawei.com> | 2017-09-20 15:14:14 +0000 |
commit | a8b497dacd36b86e0accf764a0290507923be7df (patch) | |
tree | 8fbbdf55d837a922b2145247a0d26ac0017c2b72 /PolicyEngineAPI | |
parent | b687a23edb87b2357403ff50b8e83452b7497356 (diff) |
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 <rama.subba.reddy.s@huawei.com>
Diffstat (limited to 'PolicyEngineAPI')
7 files changed, 8 insertions, 1 deletions
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 <code>String</code> format of Type for this <code>AttributeType</code> * @return the <code>String</code> of the Type for this <code>AttributeType</code> */ + @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 <code>String</code> format of delete condition for this Policy * @return the <code>String</code> 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 <code>String</code> format of Type for this <code>PolicyClass</code> * @return the <code>String</code> of the Type for this <code>PolicyClass</code> */ + @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 <code>String</code> format of Type for this <code>PolicyClass</code> * @return the <code>String</code> of the Type for this <code>PolicyClass</code> */ + @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 <code>String</code> name for this <code>PolicyConfigStatus</code> */ + @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 <code>String</code> format of Type for this <code>PolicyClass</code> * @return the <code>String</code> of the Type for this <code>PolicyClass</code> */ + @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 <code>String</code> name for this <code>PolicyDecision</code> */ + @Override public String toString(){ return this.name; } |