From c4016246908618ec75064ef102dd0cbd285ec44d Mon Sep 17 00:00:00 2001 From: NITIN KAWA Date: Fri, 26 Apr 2019 04:47:43 +0000 Subject: Removed unused imports and rearranged variables Removed unused imports and moved variables to comply with Java Code Conventions. Issue-ID: SO-1490 Change-Id: Iabf605fde63638244c2c4fd52e4787863512ee57 Signed-off-by: NITIN KAWA --- .../java/org/onap/so/bpmn/core/ResponseBuilder.java | 9 +++++---- .../org/onap/so/bpmn/core/domain/AllottedResource.java | 17 ++++++++--------- 2 files changed, 13 insertions(+), 13 deletions(-) (limited to 'bpmn') diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/ResponseBuilder.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/ResponseBuilder.java index a3f5253765..6f8d34e760 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/ResponseBuilder.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/ResponseBuilder.java @@ -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; } /** diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/AllottedResource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/AllottedResource.java index 841eaee675..c37b77d332 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/AllottedResource.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/AllottedResource.java @@ -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 */ -- cgit 1.2.3-korg