From cd6063f90b296870599a67f6a78e2738dd678463 Mon Sep 17 00:00:00 2001 From: burdziak Date: Tue, 23 Jan 2018 10:23:16 +0100 Subject: Removed unnecesary checks Issue-ID: APPC-446 Change-Id: I3d93bcff6c3ed8167dd7f273d90528a76cb2b02f Signed-off-by: burdziak --- .../artifact/handler/node/ArtifactHandlerNode.java | 24 +++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'appc-inbound/appc-artifact-handler/provider/src') diff --git a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java index 0c0fa46b0..fb197343e 100644 --- a/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java +++ b/appc-inbound/appc-artifact-handler/provider/src/main/java/org/onap/appc/artifact/handler/node/ArtifactHandlerNode.java @@ -100,15 +100,17 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { private static final EELFLogger log = EELFManager.getInstance().getLogger(ArtifactHandlerNode.class); public void processArtifact(Map inParams, SvcLogicContext ctx) throws Exception { - String responsePrefix = inParams.get("response_prefix"); + if (inParams == null || inParams.isEmpty()) + return; + String postData = inParams.get("postData"); + if(postData == null || postData.isEmpty()) + return; try { - if (inParams != null && !inParams.isEmpty() && inParams.get("postData") != null) { - log.info("Received request for process Artifact with params: " + inParams.toString()); - String postData = inParams.get("postData"); - JSONObject input = new JSONObject(postData).getJSONObject("input"); - responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : ""; - storeUpdateSdcArtifacts(input); - } + log.info("Received request for process Artifact with params: " + inParams.toString()); + JSONObject input = new JSONObject(postData).getJSONObject("input"); + String responsePrefix = inParams.get("response_prefix"); + responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : ""; + storeUpdateSdcArtifacts(input); } catch (Exception e) { e.printStackTrace(); throw e; @@ -174,8 +176,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { String toscaContents = null; ArtifactProcessorImpl toscaGenerator = new ArtifactProcessorImpl(); toscaGenerator.generateArtifact(PDFileContents, toscaStream); - if (toscaStream != null) - toscaContents = toscaStream.toString(); + toscaContents = toscaStream.toString(); log.info("Generated Tosca File : " + toscaContents); String yangContents = "YANG generation is in Progress"; @@ -199,8 +200,7 @@ public class ArtifactHandlerNode implements SvcLogicJavaPlugin { OutputStream yangStream = new ByteArrayOutputStream(); YANGGenerator yangGenerator = YANGGeneratorFactory.getYANGGenerator(); yangGenerator.generateYANG(artifactId, toscaContents, yangStream); - if (yangStream != null) - yangContents = yangStream.toString(); + yangContents = yangStream.toString(); if (yangContents != null) { updateYangContents(artifactId, ahpUtil.escapeSql(yangContents)); -- cgit 1.2.3-korg