lowred some code smells 74/107174/1
authorIndrijeet kumar <indriku1@in.ibm.com>
Wed, 6 May 2020 02:58:47 +0000 (08:28 +0530)
committerIndrijeet kumar <indriku1@in.ibm.com>
Wed, 6 May 2020 02:58:56 +0000 (08:28 +0530)
lowred some code smells

Issue-ID: PORTAL-813
Change-Id: I30e79e5f35517ac27336d813bf23806e839788d5
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/LineInfo.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/ColorProperties.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/Node.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeCollection.java
ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/node/NodeInfo.java

index 26f33a3..47e3ad5 100644 (file)
@@ -67,7 +67,7 @@ public class LineInfo {
        public LineInfo(String nodeID1, String nodeID2) {
                this.nodeID1 = nodeID1;
                this.nodeID2 = nodeID2;
-               lineAttributes = new HashMap<String, String>();
+               lineAttributes = new HashMap<>();
        }
        
        public LineInfo clone() {
@@ -167,7 +167,7 @@ public class LineInfo {
 
        public List<String> getAttributeKeys() {
                Set<String> keySet = lineAttributes.keySet();
-               List<String> keys = new ArrayList<String>(keySet.size());
+               List<String> keys = new ArrayList<>(keySet.size());
                Iterator<String> iter = keySet.iterator();
 
                while (iter.hasNext()) {
@@ -183,7 +183,7 @@ public class LineInfo {
 
        public List<String> getAttributeInternalKeys() {
                Set<String> keySet = lineAttributes.keySet();
-               List<String> internalKeys = new ArrayList<String>();
+               List<String> internalKeys = new ArrayList<>();
                Iterator<String> iter = keySet.iterator();
 
                while (iter.hasNext()) {
index 5ce752a..6e1d7e2 100644 (file)
@@ -51,7 +51,7 @@ public class ColorProperties {
        
        public ColorProperties(NovaMap map) {
                this.map = map;
-               colorProperties = new HashMap<String, Object>();
+               colorProperties = new HashMap<>();
        }
        
        public void setColor(String type, String color) {
index 60e7a16..4764ef5 100644 (file)
@@ -59,8 +59,8 @@ public class Node {
        public Node(NovaMap map) {
                this.map = map;
                nodeCollection = new NodeCollection();
-               nodeIDSet = new HashSet<String>();
-               selectionList = new ArrayList<String>();
+               nodeIDSet = new HashSet<>();
+               selectionList = new ArrayList<>();
        }
 
        public NodeInfo addNode(NodeParam nodeParam) {
@@ -121,7 +121,7 @@ public class Node {
        public Set<Integer> getUniqueNumberT1(String currentYearMonth) {
                HashMap<String,NodeInfo> hashMap = this.nodeCollection.getNodeCollection();
                Set set = hashMap.entrySet();
-               Set<Integer> numberT1Set = new TreeSet<Integer>();
+               Set<Integer> 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<NodeInfo>();
+                                       existNodeInfo = new ArrayList<>();
                                }
                                
                                existNodeInfo.add(nodeInfo);                    
index 5c3f938..e630f52 100644 (file)
@@ -53,8 +53,8 @@ public class NodeCollection {
        private HashMap<String,NodeInfo> nodeCollection;
        
        public NodeCollection() {
-               selectedNode = new HashSet<String>();
-               nodeCollection = new HashMap<String,NodeInfo>(20000);
+               selectedNode = new HashSet<>();
+               nodeCollection = new HashMap<>(20000);
        }
        
        public void addSelectedNode(String nodeID) {
index 611debc..8f4473c 100644 (file)
@@ -64,8 +64,8 @@ public class NodeInfo {
 
        public NodeInfo(String nodeID) {
                this.nodeID = nodeID;
-               lineIDS = new ArrayList<String>();
-               nodeAttributes = new TreeMap<String, String>();
+               lineIDS = new ArrayList<>();
+               nodeAttributes = new TreeMap<>();
                geoCoordinate = new GeoCoordinate();
        }
        
@@ -117,7 +117,7 @@ public class NodeInfo {
        }
        
        public List<String> cloneLineIDS() {
-               List<String> lineIDS = new ArrayList<String>();
+               List<String> 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<String, String> nodeAttributes) {
@@ -212,7 +211,7 @@ public class NodeInfo {
        
        public List<String> getAttributeKeys() {
                Set<String> keySet = nodeAttributes.keySet();
-               List<String> keys = new ArrayList<String>(keySet.size());
+               List<String> keys = new ArrayList<>(keySet.size());
                Iterator<String> iter = keySet.iterator();
                
                while (iter.hasNext()) {