summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Timoney <dtimoney@att.com>2018-12-17 20:50:12 +0000
committerGerrit Code Review <gerrit@onap.org>2018-12-17 20:50:12 +0000
commit04f53bd34109c3773ba0335fd7c28791bb9c478c (patch)
tree6e3af933db1516644f14833833d269dda8ba7012
parent54fc6f3dea49a176e4482105c9ba5f28eb053d7e (diff)
parent58ccd061d4f20bd16f45530e8ff64c7950748f5b (diff)
Merge "fixed sonar issues in SaveNodeExecutor.java"
-rw-r--r--sli/provider-base/src/main/java/org/onap/ccsdk/sli/core/sli/provider/base/SaveNodeExecutor.java11
1 files 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 2dfc4074b..f8595fff2 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<String, String> parmMap = new HashMap<String, String>();
+ Map<String, String> parmMap = new HashMap<>();
Set<Map.Entry<String, SvcLogicExpression>> 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);