Removed unused imports and rearranged variables 48/86348/1
authorNITIN KAWA <nitin.kawa@huawei.com>
Fri, 26 Apr 2019 04:47:43 +0000 (04:47 +0000)
committerNITIN KAWA <nitin.kawa@huawei.com>
Fri, 26 Apr 2019 04:47:43 +0000 (04:47 +0000)
Removed unused imports and moved variables to comply with Java Code Conventions.
Issue-ID: SO-1490

Change-Id: Iabf605fde63638244c2c4fd52e4787863512ee57
Signed-off-by: NITIN KAWA <nitin.kawa@huawei.com>
bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/ResponseBuilder.java
bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/AllottedResource.java

index a3f5253..6f8d34e 100644 (file)
@@ -40,6 +40,7 @@ import org.slf4j.LoggerFactory;
  */
 public class ResponseBuilder implements java.io.Serializable {
     private static final long serialVersionUID = 1L;
+    private static final String WORKFLOWEXCEPTION = "WorkflowException";
     private static final Logger logger = LoggerFactory.getLogger(ResponseBuilder.class);
 
     /**
@@ -61,7 +62,7 @@ public class ResponseBuilder implements java.io.Serializable {
         logger.debug("processKey=" + processKey);
 
         // See if there"s already a WorkflowException object in the execution.
-        WorkflowException theException = (WorkflowException) execution.getVariable("WorkflowException");
+        WorkflowException theException = (WorkflowException) execution.getVariable(WORKFLOWEXCEPTION);
 
         if (theException != null) {
             logger.debug("Exited " + method + " - propagated " + theException);
@@ -138,7 +139,7 @@ public class ResponseBuilder implements java.io.Serializable {
             // Create a new WorkflowException object
 
             theException = new WorkflowException(processKey, intResponseCode, errorResponse);
-            execution.setVariable("WorkflowException", theException);
+            execution.setVariable(WORKFLOWEXCEPTION, theException);
             logger.debug("Exited " + method + " - created " + theException);
             return theException;
         }
@@ -163,7 +164,7 @@ public class ResponseBuilder implements java.io.Serializable {
 
         Object theResponse = null;
 
-        WorkflowException theException = (WorkflowException) execution.getVariable("WorkflowException");
+        WorkflowException theException = (WorkflowException) execution.getVariable(WORKFLOWEXCEPTION);
         String errorResponse = trimString(execution.getVariable(prefix + "ErrorResponse"), null);
         String responseCode = trimString(execution.getVariable(prefix + "ResponseCode"), null);
 
@@ -222,7 +223,7 @@ public class ResponseBuilder implements java.io.Serializable {
         }
 
         String s = String.valueOf(object).trim();
-        return s.equals("") ? emptyStringValue : s;
+        return "".equals(s) ? emptyStringValue : s;
     }
 
     /**
index 841eaee..c37b77d 100644 (file)
@@ -22,7 +22,6 @@ package org.onap.so.bpmn.core.domain;
 
 import java.util.UUID;
 import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
 import com.fasterxml.jackson.annotation.JsonRootName;
 
 /**
@@ -34,14 +33,6 @@ public class AllottedResource extends Resource {
 
     private static final long serialVersionUID = 1L;
 
-    /*
-     * set resourceType for this object
-     */
-    public AllottedResource() {
-        resourceType = ResourceType.ALLOTTED_RESOURCE;
-        setResourceId(UUID.randomUUID().toString());
-    }
-
     /*
      * fields specific to Allotted Resource resource type
      */
@@ -59,6 +50,14 @@ public class AllottedResource extends Resource {
     @JsonIgnore
     private String resourceInput;
 
+    /*
+     * set resourceType for this object
+     */
+    public AllottedResource() {
+        resourceType = ResourceType.ALLOTTED_RESOURCE;
+        setResourceId(UUID.randomUUID().toString());
+    }
+
     /*
      * GET and SET
      */