String literal to be on the left side of string compariosion. 54/86254/1
authorh00397475 <hena.choudhury@huawei.com>
Thu, 25 Apr 2019 09:07:50 +0000 (14:37 +0530)
committerh00397475 <hena.choudhury@huawei.com>
Thu, 25 Apr 2019 09:07:50 +0000 (14:37 +0530)
String literal should be on the left side of string comparision as per guidelines.

Issue-ID: SO-1490

Change-Id: I294cbbb2fe7dae9c68b7b20e9b3a0d1d75824ba0
Signed-off-by: h00397475 <hena.choudhury@huawei.com>
adapters/mso-adapter-utils/src/main/java/org/onap/so/cloud/authentication/KeystoneV3Authentication.java
adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/beans/DeploymentInfoBuilder.java
adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/exceptions/MsoCloudifyWorkflowException.java

index f717144..35c928c 100644 (file)
@@ -72,9 +72,7 @@ public class KeystoneV3Authentication {
 
         OpenStackRequest<Token> v3Request = keystoneTenantClient.tokens().authenticate(v3Credentials);
 
-        KeystoneAuthHolder holder = makeRequest(v3Request, type, region);
-
-        return holder;
+        return makeRequest(v3Request, type, region);
     }
 
     protected KeystoneAuthHolder makeRequest(OpenStackRequest<Token> v3Request, String type, String region) {
index 02ace56..072bf40 100644 (file)
@@ -72,22 +72,22 @@ public final class DeploymentInfoBuilder {
             this.errorMessage = execution.getError();
 
             // Compute the status based on the last workflow
-            if (lastAction.equals("install")) {
-                if (actionStatus.equals("terminated")) {
+            if (("install").equals(lastAction)) {
+                if (("terminated").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.INSTALLED;
-                } else if (actionStatus.equals("failed")) {
+                } else if (("failed").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.FAILED;
-                } else if (actionStatus.equals("started") || actionStatus.equals("pending")) {
+                } else if (("started").equals(actionStatus) || ("pending").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.INSTALLING;
                 } else {
                     this.deploymentStatus = DeploymentStatus.UNKNOWN;
                 }
-            } else if (lastAction.equals("uninstall")) {
-                if (actionStatus.equals("terminated")) {
+            } else if (("uninstall").equals(lastAction)) {
+                if (("terminated").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.CREATED;
-                } else if (actionStatus.equals("failed")) {
+                } else if (("failed").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.FAILED;
-                } else if (actionStatus.equals("started") || actionStatus.equals("pending")) {
+                } else if (("started").equals(actionStatus) || ("pending").equals(actionStatus)) {
                     this.deploymentStatus = DeploymentStatus.UNINSTALLING;
                 } else {
                     this.deploymentStatus = DeploymentStatus.UNKNOWN;
index 5c2348d..2251575 100644 (file)
@@ -38,8 +38,8 @@ public class MsoCloudifyWorkflowException extends MsoCloudifyException {
         super(0, "Workflow Exception",
                 "Workflow " + workflowId + " failed on deployment " + deploymentId + ": " + message);
         this.workflowStatus = workflowStatus;
-        if (workflowStatus.equals("pending") || workflowStatus.equals("started") || workflowStatus.equals("cancelling")
-                || workflowStatus.equals("force_cancelling")) {
+        if (("pending").equals(workflowStatus) || ("started").equals(workflowStatus)
+                || ("cancelling").equals(workflowStatus) || ("force_cancelling").equals(workflowStatus)) {
             workflowStillRunning = true;
         }
     }