From 53ae6cba73ac5616471943ebab84b35f4d09aff2 Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Wed, 6 May 2020 08:28:47 +0530 Subject: lowred some code smells lowred some code smells Issue-ID: PORTAL-813 Change-Id: I30e79e5f35517ac27336d813bf23806e839788d5 Signed-off-by: Indrijeet Kumar --- .../java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java | 6 +++--- .../onap/portalsdk/analytics/gmap/map/ColorProperties.java | 2 +- .../java/org/onap/portalsdk/analytics/gmap/node/Node.java | 8 ++++---- .../onap/portalsdk/analytics/gmap/node/NodeCollection.java | 4 ++-- .../java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java | 11 +++++------ 5 files changed, 15 insertions(+), 16 deletions(-) (limited to 'ecomp-sdk/epsdk-analytics/src') diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java index 26f33a35..47e3ad54 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java @@ -67,7 +67,7 @@ public class LineInfo { public LineInfo(String nodeID1, String nodeID2) { this.nodeID1 = nodeID1; this.nodeID2 = nodeID2; - lineAttributes = new HashMap(); + lineAttributes = new HashMap<>(); } public LineInfo clone() { @@ -167,7 +167,7 @@ public class LineInfo { public List getAttributeKeys() { Set keySet = lineAttributes.keySet(); - List keys = new ArrayList(keySet.size()); + List keys = new ArrayList<>(keySet.size()); Iterator iter = keySet.iterator(); while (iter.hasNext()) { @@ -183,7 +183,7 @@ public class LineInfo { public List getAttributeInternalKeys() { Set keySet = lineAttributes.keySet(); - List internalKeys = new ArrayList(); + List internalKeys = new ArrayList<>(); Iterator iter = keySet.iterator(); while (iter.hasNext()) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java index 5ce752a7..6e1d7e24 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java @@ -51,7 +51,7 @@ public class ColorProperties { public ColorProperties(NovaMap map) { this.map = map; - colorProperties = new HashMap(); + colorProperties = new HashMap<>(); } public void setColor(String type, String color) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java index 60e7a166..4764ef50 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java @@ -59,8 +59,8 @@ public class Node { public Node(NovaMap map) { this.map = map; nodeCollection = new NodeCollection(); - nodeIDSet = new HashSet(); - selectionList = new ArrayList(); + nodeIDSet = new HashSet<>(); + selectionList = new ArrayList<>(); } public NodeInfo addNode(NodeParam nodeParam) { @@ -121,7 +121,7 @@ public class Node { public Set getUniqueNumberT1(String currentYearMonth) { HashMap hashMap = this.nodeCollection.getNodeCollection(); Set set = hashMap.entrySet(); - Set numberT1Set = new TreeSet(); + Set numberT1Set = new TreeSet<>(); for (Iterator iterator = set.iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); @@ -172,7 +172,7 @@ public class Node { } if (existNodeInfo == null) { - existNodeInfo = new ArrayList(); + existNodeInfo = new ArrayList<>(); } existNodeInfo.add(nodeInfo); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeCollection.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeCollection.java index 5c3f938a..e630f52c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeCollection.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeCollection.java @@ -53,8 +53,8 @@ public class NodeCollection { private HashMap nodeCollection; public NodeCollection() { - selectedNode = new HashSet(); - nodeCollection = new HashMap(20000); + selectedNode = new HashSet<>(); + nodeCollection = new HashMap<>(20000); } public void addSelectedNode(String nodeID) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java index 611debc3..8f4473ce 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java @@ -64,8 +64,8 @@ public class NodeInfo { public NodeInfo(String nodeID) { this.nodeID = nodeID; - lineIDS = new ArrayList(); - nodeAttributes = new TreeMap(); + lineIDS = new ArrayList<>(); + nodeAttributes = new TreeMap<>(); geoCoordinate = new GeoCoordinate(); } @@ -117,7 +117,7 @@ public class NodeInfo { } public List cloneLineIDS() { - List lineIDS = new ArrayList(); + List lineIDS = new ArrayList<>(); for (String lineID : this.lineIDS) { lineIDS.add(lineID); @@ -171,8 +171,7 @@ public class NodeInfo { } public String getAttribute(String key) { - String value = nodeAttributes.get(key); - return value; + return nodeAttributes.get(key); } public void initializeAttributes(Map nodeAttributes) { @@ -212,7 +211,7 @@ public class NodeInfo { public List getAttributeKeys() { Set keySet = nodeAttributes.keySet(); - List keys = new ArrayList(keySet.size()); + List keys = new ArrayList<>(keySet.size()); Iterator iter = keySet.iterator(); while (iter.hasNext()) { -- cgit 1.2.3-korg