aboutsummaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-action-manager/src
diff options
context:
space:
mode:
authorDivesh Mirchandani <Divesh.Mirchandani@amdocs.com>2017-09-14 19:14:21 +0530
committerDivesh Mirchandani <Divesh.Mirchandani@amdocs.com>2017-09-18 17:26:38 +0530
commit396cb378ab8940b1adb8ba1adc656d0b4ad66f99 (patch)
treeb4f6ddc8e7cdfe39bfcbdc75cff7e85c284c5b65 /openecomp-be/backend/openecomp-sdc-action-manager/src
parent27f5c2b105676eebb477714fd7323467151965d2 (diff)
Fixed SONAR issues
Fixed blocker, critical, major & minor SONAR issues. Issue-ID: SDC-343 Change-Id: I72e5a3a7fa7d7407a92f98f77e4334827f70f926 Signed-off-by: dd4616 <Divesh.Mirchandani@amdocs.com>
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-action-manager/src')
-rw-r--r--openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java22
1 files changed, 12 insertions, 10 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
index 36493e2b14..f9b6bfe8a9 100644
--- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java
@@ -694,11 +694,13 @@ public class ActionManagerImpl implements ActionManager {
String artifactName = artifactMetadata.getArtifactName();
String generatedArtifactUuId = generateActionArtifactUuId(action, artifactName);
if (generatedArtifactUuId.equals(artifactUuId)) {
- ActionArtifactEntity artifactDeleteEntity =
- new ActionArtifactEntity(artifact.getArtifactUuId(),
- getEffectiveVersion(action.getVersion()));
- actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB);
- actionArtifactDao.delete(artifactDeleteEntity);
+ if (artifact != null) {
+ ActionArtifactEntity artifactDeleteEntity =
+ new ActionArtifactEntity(artifact.getArtifactUuId(),
+ getEffectiveVersion(action.getVersion()));
+ actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB);
+ actionArtifactDao.delete(artifactDeleteEntity);
+ }
actionLogPostProcessor(StatusCode.COMPLETE, null, "", false);
log.metrics("");
}
@@ -1041,11 +1043,11 @@ public class ActionManagerImpl implements ActionManager {
action.setActionUuId(existingAction.getActionUuId());
} catch (IllegalArgumentException iae) {
String message = iae.getMessage();
- switch (message) {
- case VERSION_STRING_VIOLATION_MSG:
- throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message);
- default:
- throw iae;
+ if(message == VERSION_STRING_VIOLATION_MSG) {
+ throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message);
+ }
+ else {
+ throw iae;
}
}
}