Sonar Major 01/35101/1
authorSP00501638 <SP00501638@techmahindra.com>
Mon, 12 Mar 2018 05:42:40 +0000 (11:12 +0530)
committerSP00501638 <SP00501638@techmahindra.com>
Mon, 12 Mar 2018 05:42:57 +0000 (11:12 +0530)
Move the null string literal on the left side of this string comparison
CreateFirewallController.java:L347

Sonar Link:
https://sonar.onap.org/project/issues?id=org.onap.policy.engine%3APolicyEngineSuite&myIssues=true&open=AWBFphN0-08if2a6vI7H&resolved=false&severities=MAJOR

Location:
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java

Change-Id: I744a66f3622fb7db0933c7c7dabc520e859cff4d
Issue-ID: POLICY-685
Signed-off-by: SP00501638 <SP00501638@techmahindra.com>
POLICY-SDK-APP/src/main/java/org/onap/policy/controller/CreateFirewallController.java

index 7001aa9..3e24dc7 100644 (file)
@@ -344,7 +344,7 @@ public class CreateFirewallController extends RestrictedBaseController {
                                jpaTermList = (TermList) tmList.get(0);
                                if (jpaTermList != null){                               
                                        ruleSrcList= jpaTermList.getSrcIPList();        
-                                       if ((ruleSrcList!= null) && (!ruleSrcList.isEmpty()) && !ruleSrcList.equals("null")){
+                                       if ((ruleSrcList!= null) && (!ruleSrcList.isEmpty()) && !"null".equals(ruleSrcList)){
                                                displayString.append("Source IP List: " + jpaTermList.getSrcIPList());
                                                displayString.append(" ; \t\n");
                                                for(String srcList:ruleSrcList.split(",")){