From 58ccd061d4f20bd16f45530e8ff64c7950748f5b Mon Sep 17 00:00:00 2001 From: Sandeep J Date: Mon, 17 Dec 2018 11:46:04 +0530 Subject: fixed sonar issues in SaveNodeExecutor.java fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I7b1ad4167f84da2820eb81f8951237428353612a Signed-off-by: Sandeep J --- .../ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.java b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.java index 2dfc4074..f8595fff 100644 --- a/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.java +++ b/sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.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 @@ -36,6 +38,7 @@ import org.slf4j.LoggerFactory; public class SaveNodeExecutor extends AbstractSvcLogicNodeExecutor { private static final Logger LOG = LoggerFactory.getLogger(SaveNodeExecutor.class); + private static final String FAILURE= "failure"; @Override public SvcLogicNode execute(SvcLogicServiceBase svc, SvcLogicNode node, SvcLogicContext ctx) @@ -51,7 +54,7 @@ public class SaveNodeExecutor extends AbstractSvcLogicNodeExecutor { boolean force = "true".equalsIgnoreCase(forceStr); boolean localOnly = "true".equalsIgnoreCase(localOnlyStr); - Map parmMap = new HashMap(); + Map parmMap = new HashMap<>(); Set> parmSet = node.getParameterSet(); boolean hasParms = false; @@ -70,7 +73,7 @@ public class SaveNodeExecutor extends AbstractSvcLogicNodeExecutor { } } - String outValue = "failure"; + String outValue = FAILURE; if (LOG.isDebugEnabled()) { LOG.debug("save node encountered - looking for resource class " + plugin); @@ -92,11 +95,11 @@ public class SaveNodeExecutor extends AbstractSvcLogicNodeExecutor { 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); -- cgit 1.2.3-korg