From 532db6daf1c0d0c9b0767eb7191385ad1a709516 Mon Sep 17 00:00:00 2001 From: "Sonsino, Ofir (os0695)" Date: Thu, 22 Nov 2018 10:13:46 +0200 Subject: DAO sonar fixes Change-Id: I453fdb5f2aa1488adbf0664a624a98b239d4a927 Issue-ID: SDC-1954 Signed-off-by: Sonsino, Ofir (os0695) --- .../sdc/be/externalapi/servlet/ArtifactExternalServlet.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'catalog-be') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java index f3cf5944b4..c53e343512 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java @@ -65,7 +65,6 @@ import javax.ws.rs.core.Response; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.EnumMap; import java.util.HashMap; import java.util.Map; /** @@ -80,6 +79,8 @@ import java.util.Map; @Singleton public class ArtifactExternalServlet extends AbstractValidationsServlet { + private static final String FAILED_TO_UPDATE_ARTIFACT = "failed to update artifact"; + @Context private HttpServletRequest request; @@ -146,7 +147,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { Either uploadArtifactEither = artifactsLogic.updateArtifactOnInterfaceOperationByResourceUUID(data, request, componentType, uuid, artifactUUID, operationUUID, resourceCommonInfo, artifactsLogic.new ArtifactOperationInfo(true, false, ArtifactOperationEnum.UPDATE)); if (uploadArtifactEither.isRight()) { - log.debug("failed to update artifact"); + log.debug(FAILED_TO_UPDATE_ARTIFACT); responseFormat = uploadArtifactEither.right().value(); responseWrapper.setInnerElement(buildErrorResponse(responseFormat)); } else { @@ -452,7 +453,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { Either uploadArtifactEither = artifactsLogic.updateArtifactOnComponentByUUID(data, request, componentType, uuid, artifactUUID, resourceCommonInfo, artifactsLogic.new ArtifactOperationInfo(true, false, ArtifactOperationEnum.UPDATE)); if (uploadArtifactEither.isRight()) { - log.debug("failed to update artifact"); + log.debug(FAILED_TO_UPDATE_ARTIFACT); responseFormat = uploadArtifactEither.right().value(); responseWrapper.setInnerElement(buildErrorResponse(responseFormat)); } else { @@ -552,7 +553,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { Either uploadArtifactEither = artifactsLogic.updateArtifactOnRiByUUID(data, request, componentType, uuid, resourceInstanceName, artifactUUID, artifactsLogic.new ArtifactOperationInfo(true, false, ArtifactOperationEnum.UPDATE)); if (uploadArtifactEither.isRight()) { - log.debug("failed to update artifact"); + log.debug(FAILED_TO_UPDATE_ARTIFACT); responseFormat = uploadArtifactEither.right().value(); responseWrapper.setInnerElement(buildErrorResponse(responseFormat)); } else { -- cgit 1.2.3-korg