aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-14 19:40:00 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-14 19:40:16 +0530
commit3c2340d43215dee18382cd4a1d45904fad539422 (patch)
tree043b87758e5a6efad3e544a27f053b8b7b293291
parent6dd2c1b07cc306750dd9ee93cf8bb2f615f076aa (diff)
fixed sonar issues in ExecuteNodeExecutor.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I94f1141f291ee356742f1cd220fc1acc07c6932b Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/ExecuteNodeExecutor.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/ExecuteNodeExecutor.java b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/ExecuteNodeExecutor.java
index 357f11d0..e9fe78e8 100644
--- a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/ExecuteNodeExecutor.java
+++ b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/ExecuteNodeExecutor.java
@@ -5,6 +5,8 @@
* Copyright (C) 2017 AT&T Intellectual Property. All rights
* reserved.
* ================================================================================
+ * Modifications Copyright (C) 2018 IBM.
+ * ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
@@ -39,6 +41,7 @@ import org.slf4j.LoggerFactory;
public class ExecuteNodeExecutor extends AbstractSvcLogicNodeExecutor {
private static final Logger LOG = LoggerFactory
.getLogger(ExecuteNodeExecutor.class);
+ private static final String FAILURE="failure";
private static final String pluginErrorMessage = "Could not execute plugin. SvcLogic status will be set to failure.";
public SvcLogicNode execute(SvcLogicServiceBase svc, SvcLogicNode node,
@@ -46,7 +49,7 @@ public class ExecuteNodeExecutor extends AbstractSvcLogicNodeExecutor {
String pluginName = SvcLogicExpressionResolver.evaluate(
node.getAttribute("plugin"), node, ctx);
- String outValue = "failure";
+ String outValue = FAILURE;
if (LOG.isDebugEnabled()) {
LOG.debug("execute node encountered - looking for plugin "
@@ -76,7 +79,7 @@ public class ExecuteNodeExecutor extends AbstractSvcLogicNodeExecutor {
} else {
try {
- Map<String, String> parmMap = new HashMap<String, String>();
+ Map<String, String> parmMap = new HashMap<>();
Set<Map.Entry<String, SvcLogicExpression>> parmSet = node
.getParameterSet();
@@ -104,16 +107,16 @@ public class ExecuteNodeExecutor extends AbstractSvcLogicNodeExecutor {
}else{
LOG.error(pluginErrorMessage, e);
}
- outValue = "failure";
- ctx.setStatus("failure");
+ outValue = FAILURE;
+ ctx.setStatus(FAILURE);
} catch (IllegalAccessException e) {
LOG.error(pluginErrorMessage, e);
- outValue = "failure";
- ctx.setStatus("failure");
+ outValue = FAILURE;
+ ctx.setStatus(FAILURE);
} catch (IllegalArgumentException e) {
LOG.error(pluginErrorMessage, e);
- outValue = "failure";
- ctx.setStatus("failure");
+ outValue = FAILURE;
+ ctx.setStatus(FAILURE);
}
}