Sonar Major 87/35187/2
authorSP00501638 <SP00501638@techmahindra.com>
Mon, 12 Mar 2018 11:35:16 +0000 (17:05 +0530)
committerPamela Dragosh <pdragosh@research.att.com>
Tue, 13 Mar 2018 12:09:24 +0000 (12:09 +0000)
Move the api string literal on the left side of this string comparison
XACMLPapServlet.java:L1179

Sonar Link:
https://sonar.onap.org/issues?myIssues=true&open=AV2blOo25bp_wwmIUQnh&resolved=false&severities=MAJOR

Location:
ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java

Line Number:1179

Change-Id: I937caaca01107d2a11be4050ff7be5e5dc66acb6
Issue-ID: POLICY-690
Signed-off-by: SP00501638 <SP00501638@techmahindra.com>
ONAP-PAP-REST/src/main/java/org/onap/policy/pap/xacml/rest/XACMLPapServlet.java

index 650713c..84cd72f 100644 (file)
@@ -1176,7 +1176,7 @@ public class XACMLPapServlet extends HttpServlet implements StdItemSetChangeList
                        PolicyLogger.audit("Transaction Ended Successfully");
                        im.endTransaction();
                        return;
-               } else if (apiflag != null && apiflag.equalsIgnoreCase("api")) {
+               } else if (apiflag != null && "api".equalsIgnoreCase(apiflag)) {
                        // this request is from the Policy Creation API 
                        if(authorizeRequest(request)){
                                APIRequestHandler apiRequestHandler = new APIRequestHandler();