Move "*" string literal on left side of string 54/98654/1
authoranushadasari <danush10@in.ibm.com>
Wed, 20 Nov 2019 10:27:35 +0000 (15:57 +0530)
committeranushadasari <danush10@in.ibm.com>
Wed, 20 Nov 2019 10:27:52 +0000 (15:57 +0530)
It is preferable to place string literals on the left-hand side of an equals() or equalsIgnoreCase() method call.

Issue-ID: OPTFRA-647
Change-Id: Idd9ac257f96553a00f8a455a48d678adb167a382
Signed-off-by: anushadasari <danush10@in.ibm.com>
cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/aaf/AafUserRole.java

index 295221c..cda740f 100755 (executable)
@@ -158,7 +158,7 @@ public class AafUserRole {
         while (!inNodes.isEmpty() && !matchNodes.isEmpty()) {\r
             String inNode = inNodes.remove(0);\r
             String matchNode = matchNodes.get(0);\r
-            if (matchNode.equals(inNode) || matchNode.equals("*")) {\r
+            if (matchNode.equals(inNode) || "*".equals(matchNode)) {\r
                 matchNodes.remove(0);\r
             } else {\r
                 if (!matchNode.equals("**")) {\r
@@ -174,10 +174,10 @@ public class AafUserRole {
 \r
         // We have incoming nodes remaining, see if we can wildcard them\r
         if (matchNodes.size() == 1) {\r
-            if (matchNodes.get(0).equals("**")) {\r
+            if ("**".equals(matchNodes.get(0))) {\r
                 return true;\r
             }\r
-            if (inNodes.size() == 1 && matchNodes.get(0).equals("*")) {\r
+            if (inNodes.size() == 1 && "*".equals(matchNodes.get(0))) {\r
                 return true;\r
             }\r
         }\r