summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSandeep J <sandeejh@in.ibm.com>2018-12-07 16:39:13 +0530
committerSandeep J <sandeejh@in.ibm.com>2018-12-07 16:39:19 +0530
commitae126c693fc024d83fcba7504955aa5156c0b986 (patch)
tree3ee93d19c240433e55c5d5420f06582d50fd9c0d
parent7db11491f101ed834da2f73958647240502677df (diff)
fixed sonar issues in SvcLogicNode.java
fixed sonar issues Issue-ID: CCSDK-525 Change-Id: I2f7e33601cac898069836bc5461e92dc5fe5d442 Signed-off-by: Sandeep J <sandeejh@in.ibm.com>
-rw-r--r--sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java
index 45f68351..72cfea50 100644
--- a/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.java
+++ b/sli/common/src/main/java/org/onap/ccsdk/sli/core/sli/SvcLogicNode.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
@@ -31,6 +33,7 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
+import java.util.HashSet;
import java.util.TreeMap;
import org.apache.commons.lang3.StringEscapeUtils;
@@ -61,8 +64,8 @@ public class SvcLogicNode implements Serializable {
nodeName = "";
this.nodeType = nodeType;
this.graph = graph;
- attributes = new HashMap<String, SvcLogicExpression> ();
- parameters = new HashMap<String, SvcLogicExpression> ();
+ attributes = new HashMap<> ();
+ parameters = new HashMap<> ();
outcomes = null;
}
@@ -73,8 +76,8 @@ public class SvcLogicNode implements Serializable {
this.nodeName = nodeName;
this.nodeType = nodeType;
this.graph = graph;
- attributes = new HashMap<String, SvcLogicExpression> ();
- parameters = new HashMap<String, SvcLogicExpression> ();
+ attributes = new HashMap<> ();
+ parameters = new HashMap<> ();
outcomes = null;
graph.setNamedNode(nodeName, this);
}
@@ -224,7 +227,7 @@ public class SvcLogicNode implements Serializable {
{
if (outcomes == null)
{
- outcomes = new HashMap<String, SvcLogicNode>();
+ outcomes = new HashMap<>();
}
if (outcomeValue.length() == 0) {
@@ -242,7 +245,7 @@ public class SvcLogicNode implements Serializable {
{
if (outcomes == null)
{
- return null;
+ return new HashSet<>();
}
return outcomes.entrySet();
@@ -253,7 +256,7 @@ public class SvcLogicNode implements Serializable {
{
if (parameters == null)
{
- return null;
+ return new HashSet<>();
}
return parameters.entrySet();
@@ -307,7 +310,7 @@ public class SvcLogicNode implements Serializable {
if (outcomes != null)
{
- TreeMap<String, SvcLogicNode> sortedOutcomes = new TreeMap<String, SvcLogicNode>(outcomes);
+ TreeMap<String, SvcLogicNode> sortedOutcomes = new TreeMap<>(outcomes);
Set<Map.Entry<String, SvcLogicNode>> outcomeSet = sortedOutcomes.entrySet();
for (Iterator<Map.Entry<String, SvcLogicNode>> iter = outcomeSet.iterator(); iter.hasNext();)