From 7198eda75d9f8127a65cc200d0cf402cbde3007e Mon Sep 17 00:00:00 2001 From: burdziak Date: Wed, 7 Aug 2019 14:13:58 +0200 Subject: Fix sonar issues in Line.java Change-Id: Ia1f3df384e82d6e7d9aab02339b6b682f672415c Issue-ID: PORTAL-523 Signed-off-by: burdziak --- .../java/org/onap/portalsdk/analytics/gmap/line/Line.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/Line.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/Line.java index 6e17ed3d..f3b0cd85 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/Line.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/line/Line.java @@ -47,20 +47,14 @@ import org.onap.portalsdk.analytics.gmap.map.NovaMap; public class Line { private NovaMap map; private LineCollection lineCollection; - private ArrayList selectionList; - private Set lineIDSet; public Line(NovaMap map) { this.map = map; lineCollection = new LineCollection(); - lineIDSet = new HashSet(); - selectionList = new ArrayList(); } public ArrayList lineExist(Point2D screenPoint) { ArrayList 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(); + existLineInfo = new ArrayList<>(); } existLineInfo.add(lineInfo); -- cgit 1.2.3-korg