diff options
author | rob.bog <r.bogacki@samsung.com> | 2019-05-28 13:18:24 +0200 |
---|---|---|
committer | r.bogacki <r.bogacki@samsung.com> | 2019-06-03 12:26:59 +0200 |
commit | a2df406852f02374c81afc8231639c7cb482f10e (patch) | |
tree | 17c234a0b796217b0abb554d291364b400e9b26b /bpmn/so-bpmn-infrastructure-common/src/main/java | |
parent | 1640ac602723737c8f15a9a84046e709f7230a1c (diff) |
Cleaned up duplicated literals
Cleaned up Sonar code smells related to the duplicated
literals in loggers.
Issue-ID: SO-1932
Signed-off-by: Robert Bogacki <r.bogacki@samsung.com>
Change-Id: I58c48cec0012c42b7b892ae76c24c6a087c60c7e
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common/src/main/java')
3 files changed, 6 insertions, 3 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java index 5451f9ff57..1b32029fd6 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -27,6 +27,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.Map; +import com.google.common.base.Strings; import org.apache.commons.lang3.StringUtils; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; @@ -282,7 +283,7 @@ public abstract class AbstractSdncOperationTask extends BaseTask { } catch (Exception exception) { logger.info("exception: AbstractSdncOperationTask.updateProgress fail!"); logger.error("exception: AbstractSdncOperationTask.updateProgress fail:", exception); - logger.error("{} {} {} {} {}", MessageEnum.GENERAL_EXCEPTION.toString(), + logger.error(Strings.repeat("{} ", 5), MessageEnum.GENERAL_EXCEPTION.toString(), " updateProgress catch exception: ", this.getTaskName(), ErrorCode.UnknownError.getValue(), exception.getClass().toString()); } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java index 4d58439fda..4703dddf54 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncNetworkTopologyOperationTask.java @@ -23,6 +23,7 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask; import java.util.Map; +import com.google.common.base.Strings; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; @@ -78,7 +79,7 @@ public class SdncNetworkTopologyOperationTask extends AbstractSdncOperationTask httpPost.addHeader("Authorization", defaulAuth); httpPost.addHeader("Content-type", "application/json"); String postBody = getPostbody(inputEntity); - logger.info("{} {} {}", MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC"); + logger.info(Strings.repeat("{} ", 3), MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC"); httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML)); httpPost(url, httpPost); logger.info("SdncNetworkTopologyOperationTask.send2SdncDirectly end!"); diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java index 4fb6817a39..bdc0e2952b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java @@ -24,6 +24,7 @@ package org.onap.so.bpmn.infrastructure.workflow.serviceTask; import java.util.Map; +import com.google.common.base.Strings; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; @@ -77,7 +78,7 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask httpPost.addHeader("Authorization", defaulAuth); httpPost.addHeader("Content-type", "application/json"); String postBody = getPostbody(inputEntity); - logger.info("{} {} {}", MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC"); + logger.info(Strings.repeat("{} ", 3), MessageEnum.RA_SEND_REQUEST_SDNC, postBody, "SDNC"); httpPost.setEntity(new StringEntity(postBody, ContentType.APPLICATION_XML)); httpPost(url, httpPost); logger.info("SdncServiceTopologyOperationTask.send2SdncDirectly end!"); |