Fix for Sonar major issues 13/13713/6
authorrama-huawei <rama.subba.reddy.s@huawei.com>
Wed, 20 Sep 2017 06:34:57 +0000 (12:04 +0530)
committerRama SubbaReddy <rama.subba.reddy.s@huawei.com>
Wed, 20 Sep 2017 15:14:14 +0000 (15:14 +0000)
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>
PolicyEngineAPI/src/main/java/org/onap/policy/api/AttributeType.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/DeletePolicyCondition.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/DictionaryType.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyClass.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigStatus.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyConfigType.java
PolicyEngineAPI/src/main/java/org/onap/policy/api/PolicyDecision.java
PolicyEngineUtils/src/main/java/org/onap/policy/api/NotificationHandler.java

index 8cfa512..0a46219 100644 (file)
@@ -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;
        }
index 4001d3f..117ac71 100644 (file)
@@ -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;
        }
index 5ac6d5e..499295d 100644 (file)
@@ -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;
        }
index 5132a44..6a648e8 100644 (file)
@@ -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;
        }
index 23291c9..cee1567 100644 (file)
@@ -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;
        }
index 59fd427..2fb5d96 100644 (file)
@@ -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;
        }
index b5fdc1e..6bae84c 100644 (file)
@@ -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;
        }
index 6484a9d..837eba9 100644 (file)
@@ -24,6 +24,7 @@ package org.onap.policy.api;
  *  
  * @version 0.1
  */
+@FunctionalInterface
 public interface NotificationHandler {
        /**
         * <code>notificationReceived</code> method will be triggered automatically whenever a Notification is received by the PEP.