Fix sonar issues in Line.java 68/93468/1
authorburdziak <olaf.burdziakowski@nokia.com>
Wed, 7 Aug 2019 12:13:58 +0000 (14:13 +0200)
committerManoop Talasila <talasila@research.att.com>
Tue, 13 Aug 2019 18:29:04 +0000 (18:29 +0000)
Change-Id: Ia1f3df384e82d6e7d9aab02339b6b682f672415c
Issue-ID: PORTAL-523
Signed-off-by: burdziak <olaf.burdziakowski@nokia.com>
(cherry picked from commit 7198eda75d9f8127a65cc200d0cf402cbde3007e)

ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/Line.java

index 6e17ed3..f3b0cd8 100644 (file)
@@ -47,20 +47,14 @@ import org.onap.portalsdk.analytics.gmap.map.NovaMap;
 public class Line {
        private NovaMap map;
        private LineCollection lineCollection;
-       private ArrayList<String> selectionList;
-       private Set<String> lineIDSet;
        
        public Line(NovaMap map) {
                this.map = map;
                lineCollection = new LineCollection();
-               lineIDSet = new HashSet<String>();
-               selectionList = new ArrayList<String>();
        }
        
        public ArrayList<LineInfo> lineExist(Point2D screenPoint) {
                ArrayList<LineInfo> existLineInfo = null;
-               String selectedLine = null;
-               String selectedType = null;
                int nearest = -1;
                int nodeSize = map.getShapeWidth();
                nodeSize = nodeSize > 20 ? 20 : nodeSize;
@@ -82,17 +76,13 @@ public class Line {
                                        diff < (Math.abs(y1 - y2) + Math.abs(x1 - x2)) * (int) (nodeSize * .2)) {
                                if (nearest == -1) {
                                        nearest = diff;
-                                       selectedLine = lineInfo.getLineID();
-                                       selectedType = lineInfo.getLineType();
                                }
                                else if (diff <= nearest) {
                                        nearest = diff;
-                                       selectedLine = lineInfo.getLineID();
-                                       selectedType = lineInfo.getLineType();
                                }
                                
                                if (existLineInfo == null) {
-                                       existLineInfo = new ArrayList<LineInfo>();
+                                       existLineInfo = new ArrayList<>();
                                }
                                
                                existLineInfo.add(lineInfo);