From: ezhil Date: Fri, 30 Nov 2018 12:58:29 +0000 (+0530) Subject: Fixed Sonar issue in DeleteNodeExecutor.java X-Git-Tag: 1.0.4~9^2~175^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=31252640fff84fb2351696105751eae4f3240ed2;p=ccsdk%2Fsli.git Fixed Sonar issue in DeleteNodeExecutor.java Replaced litrals with constant Issue-ID: CCSDK-776 Change-Id: I58c02ec0ee78e9e4b852aa11266dc720fffbd172 Signed-off-by: ezhil --- diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/DeleteNodeExecutor.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/DeleteNodeExecutor.java index 571dd37cd..18f1ce9a7 100644 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/DeleteNodeExecutor.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/DeleteNodeExecutor.java @@ -31,6 +31,7 @@ import org.slf4j.LoggerFactory; public class DeleteNodeExecutor extends SvcLogicNodeExecutor { private static final Logger LOG = LoggerFactory.getLogger(DeleteNodeExecutor.class); + private static final String FAILURE="failure"; @Override public SvcLogicNode execute(SvcLogicService svc, SvcLogicNode node, SvcLogicContext ctx) @@ -40,7 +41,7 @@ public class DeleteNodeExecutor extends SvcLogicNodeExecutor { String resourceType = SvcLogicExpressionResolver.evaluate(node.getAttribute("resource"), node, ctx); String key = SvcLogicExpressionResolver.evaluateAsKey(node.getAttribute("key"), node, ctx); - String outValue = "failure"; + String outValue = FAILURE; if (LOG.isDebugEnabled()) { LOG.debug("delete node encountered - looking for resource class " + plugin); @@ -58,11 +59,11 @@ public class DeleteNodeExecutor extends SvcLogicNodeExecutor { break; case FAILURE: default: - outValue = "failure"; + outValue = FAILURE; } } catch (SvcLogicException e) { LOG.error("Caught exception from resource plugin", e); - outValue = "failure"; + outValue = FAILURE; } } else { LOG.warn("Could not find SvcLogicResource object for plugin " + plugin);