From 8b593147c3d890685184fd775157ef84f4df112e Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Wed, 6 May 2020 09:13:16 +0530 Subject: code smells removed code smells removed Issue-ID: PORTAL-813 Change-Id: Ia2148e9d874162b776147c88860a0366071c4ed2 Signed-off-by: Indrijeet Kumar --- .../org/onap/portalsdk/analytics/gmap/map/NovaMap.java | 6 +++--- .../portalsdk/analytics/gmap/map/layer/SwingLayer.java | 4 ++-- .../org/onap/portalsdk/analytics/model/ReportHandler.java | 6 +++--- .../org/onap/portalsdk/analytics/model/ReportLoader.java | 2 +- .../portalsdk/analytics/model/runtime/ChartD3Helper.java | 14 +++++++------- .../portalsdk/analytics/model/runtime/ChartJSONHelper.java | 10 +++++----- .../portalsdk/analytics/model/runtime/ReportRuntime.java | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) (limited to 'ecomp-sdk') diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java index 90d16649..6473bc6f 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/NovaMap.java @@ -140,8 +140,8 @@ public class NovaMap { boundingBox = new Rectangle(); mapArea = new Rectangle2D.Double(); geoArea = new Rectangle2D.Double(); - showList = new HashSet(); - swingLayers = new ArrayList(); + showList = new HashSet<>(); + swingLayers = new ArrayList<>(); } public int getBestZoomLevel(double Latitude1, double Longitude1, double Latitude2, double Longitude2, double height, @@ -389,7 +389,7 @@ public class NovaMap { BufferedImage legendImage = null; Graphics2D g2Legend = null; if (showLegend) { - legendImage = new BufferedImage(boundingBox.width, (int) (20 * showListArr.length) + 20, + legendImage = new BufferedImage(boundingBox.width,(20 * showListArr.length) + 20, BufferedImage.TYPE_INT_ARGB); g2Legend = legendImage.createGraphics(); g2Legend.setBackground(Color.WHITE); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java index a9a2fba6..ae6237ca 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/gmap/map/layer/SwingLayer.java @@ -85,7 +85,7 @@ public class SwingLayer { HashMap hashMap = node.getNodeCollection().getNodeCollection(); Set set = hashMap.entrySet(); int width = map.getShapeWidth(); - ArrayList visibleLabel = new ArrayList(151); + ArrayList visibleLabel = new ArrayList<>(151); Color oldColor = g2d.getColor(); Stroke oldStroke = g2d.getStroke(); int textWidth = 0; @@ -186,7 +186,7 @@ public class SwingLayer { } String legendName = ""; int baseY = 0; - baseY = (int)(20*showListArr.length) + 20;//+5; + baseY = (20*showListArr.length) + 20;//+5; int baseX = 0; if(map.isShowLegend()) { for (int i = showListArr.length-1; i>=0; i--) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java index dc3b1a88..3443cf6d 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportHandler.java @@ -4242,8 +4242,8 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { } } SemaphoreList semList = rr.getSemaphoreList(); - Map hashMapStyles = new HashMap();; - Map hashMapFonts = new HashMap(); + Map hashMapStyles = new HashMap<>();; + Map hashMapFonts = new HashMap<>(); hashMapFonts.put("default", fontDefault); hashMapStyles.put("default", styleDefault); XSSFCellStyle styleLeftDefault = wb.createCellStyle(); @@ -4509,7 +4509,7 @@ public class ReportHandler extends org.onap.portalsdk.analytics.RaptorObject { sw.endRow(); //All the possible combinations of date format CreationHelper createHelper = wb.getCreationHelper(); - HashMap dateFormatMap = new HashMap(); + HashMap dateFormatMap = new HashMap<>(); SimpleDateFormat MMDDYYYYFormat = new SimpleDateFormat("MM/dd/yyyy"); SimpleDateFormat YYYYMMDDFormat = new SimpleDateFormat("yyyy/MM/dd"); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java index 8072d730..0bdcc6fd 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/ReportLoader.java @@ -515,7 +515,7 @@ public class ReportLoader extends org.onap.portalsdk.analytics.RaptorObject { DataSet ds = DbUtils .executeQuery(query); - ArrayList quickLinksArray = new ArrayList(ds.getRowCount()); + ArrayList quickLinksArray = new ArrayList<>(ds.getRowCount()); for (int i = 0; i < ds.getRowCount(); i++) { QuickLink quickLink = new QuickLink(); StringBuffer link = new StringBuffer(""); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java index 52077aa8..72769e3f 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartD3Helper.java @@ -393,7 +393,7 @@ public class ChartD3Helper { } // added to load all date elements - HashMap> dataSeriesMap = new HashMap>(); + HashMap> dataSeriesMap = new HashMap<>(); for (int i = 0; i < uniqueElements.length; i++) { if(multipleSeries && (nvl(chartRightAxisLabel).length() > 0)) @@ -427,9 +427,9 @@ public class ChartD3Helper { int formatFlag = 0; - TreeSet dateStrList = new TreeSet(); + TreeSet dateStrList = new TreeSet<>(); // added to store all date elements - SortedSet sortSet = new TreeSet(); + SortedSet sortSet = new TreeSet<>(); int count = 0; if(flag!= 1) { HashMap dataSeriesStrMap = new HashMap(); @@ -780,7 +780,7 @@ public class ChartD3Helper { for (int i = 0; i < uniqueElements.length; i++) { HashMap dataMap = dataSeriesMap.get((String)uniqueElements[i]); Set keySet = dataMap.keySet(); - ArrayList keySortedList = new ArrayList(new TreeSet(keySet)); + ArrayList keySortedList = new ArrayList<>(new TreeSet(keySet)); for (int k=0; k < keySortedList.size(); k++) { valueStr = dataSeriesMap.get((String)uniqueElements[i]).get(keySortedList.get(k)); @@ -1723,7 +1723,7 @@ public class ChartD3Helper { double value = 0; int flagNull = 0; String COLOR = ""; - TreeSet colorList = new TreeSet(); + TreeSet colorList = new TreeSet<>(); for (int i = 0; i < ds.getRowCount(); i++) { value = 0; try { @@ -1845,9 +1845,9 @@ public class ChartD3Helper { int formatFlag = 0; - TreeSet dateStrList = new TreeSet(); + TreeSet dateStrList = new TreeSet<>(); // added to store all date elements - SortedSet sortSet = new TreeSet(); + SortedSet sortSet = new TreeSet<>(); int count = 0; int flag = 0; diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java index 6003222b..0caca218 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartJSONHelper.java @@ -417,7 +417,7 @@ public class ChartJSONHelper { List dcList = reportRuntime.getOnlyVisibleColumns(); int countIndex = 0; - ArrayList chartColumnJSONList = new ArrayList(); + ArrayList chartColumnJSONList = new ArrayList<>(); for(Iterator iter = dcList.iterator(); iter.hasNext(); ) { ChartColumnJSON ccJSON = new ChartColumnJSON(); DataColumnType dc = (DataColumnType) iter.next(); @@ -484,7 +484,7 @@ public class ChartJSONHelper { if(chartValueCols.size() <= 0) { chartValueCols = reportCols; } - ArrayList rangeAxisJSONList = new ArrayList(); + ArrayList rangeAxisJSONList = new ArrayList<>(); for (int k = 0; k < chartValueCols.size(); k++) { dct_RangeAxis = chartValueCols.get(k); RangeAxisJSON rangeAxisJSON = new RangeAxisJSON(); @@ -577,12 +577,12 @@ public class ChartJSONHelper { chartJSON.setMaxRange(reportRuntime.getRangeAxisUpperLimit()); if(showData) { - ArrayList> wholeList = new ArrayList>(); + ArrayList> wholeList = new ArrayList<>(); - ArrayList rowList = new ArrayList(); + ArrayList rowList = new ArrayList<>(); if(showData) { for (int i = 0; i < ds.getRowCount(); i++) { - rowList = new ArrayList(); + rowList = new ArrayList<>(); for (int j = 0; j v1= null, v2 = null; - ArrayList temp = new ArrayList(); + ArrayList temp = new ArrayList<>(); if (Globals.getMergeCrosstabRowHeadings()) { for (int i = 0; i < dataList.size(); i++) { drInFor1 = (DataRow)dataList.get(i); -- cgit 1.2.3-korg