summaryrefslogtreecommitdiffstats
path: root/ONAP-PAP-REST/src/main/java/org/onap
diff options
context:
space:
mode:
authorshashikanth <shashikanth.vh@huawei.com>2017-09-28 14:18:06 +0530
committershashikanth <shashikanth.vh@huawei.com>2017-09-28 14:18:06 +0530
commitebc9e66ae4b4cc5a74e7355a8622b3c50a111bf7 (patch)
tree31d4b3320572894f85241573c608d297b00948f0 /ONAP-PAP-REST/src/main/java/org/onap
parentb6dee4c18a7384e765a36a8dbbaef301da232847 (diff)
Fix major sonar issues
Fix major sonar issues in policy/engine module https://sonar.onap.org/component_issues?id=org.onap.policy.engine%3APolicyEngineSuite#resolved=false|severities=MAJOR|rules=squid%3AS1132|fileUuids=AV2blNYr5bp_wwmIUP_g Move the "Duplicate" string literal on the left side of this string comparison. Issue-Id:POLICY-272 Change-Id: I78d4d627aa58fd90340c9e780728bae12a0b78bc Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
Diffstat (limited to 'ONAP-PAP-REST/src/main/java/org/onap')
-rw-r--r--ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DecisionPolicyDictionaryController.java34
1 files changed, 16 insertions, 18 deletions
diff --git a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DecisionPolicyDictionaryController.java b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DecisionPolicyDictionaryController.java
index ab077b9ca..f4e32ebea 100644
--- a/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DecisionPolicyDictionaryController.java
+++ b/ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/controller/DecisionPolicyDictionaryController.java
@@ -20,19 +20,9 @@
package org.onap.policy.pap.xacml.rest.controller;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.JsonNode;
+import com.fasterxml.jackson.databind.ObjectMapper;
import org.json.JSONObject;
import org.onap.policy.common.logging.flexlogger.FlexLogger;
import org.onap.policy.common.logging.flexlogger.Logger;
@@ -49,9 +39,17 @@ import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.JsonNode;
-import com.fasterxml.jackson.databind.ObjectMapper;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
@Controller
public class DecisionPolicyDictionaryController {
@@ -184,7 +182,7 @@ public class DecisionPolicyDictionaryController {
}
if (fromAPI) {
- if (responseString!=null && !responseString.equals("Duplicate")) {
+ if (!"Duplicate".equals(responseString)) {
if(isFakeUpdate){
responseString = "Exists";
} else {
@@ -352,7 +350,7 @@ public class DecisionPolicyDictionaryController {
}
if (fromAPI) {
- if (responseString!=null && !responseString.equals("Duplicate")) {
+ if (!"Duplicate".equals(responseString)) {
if(isFakeUpdate){
responseString = "Exists";
} else {