diff options
author | Indrijeet kumar <indriku1@in.ibm.com> | 2020-05-06 09:13:16 +0530 |
---|---|---|
committer | Indrijeet kumar <indriku1@in.ibm.com> | 2020-05-06 09:13:24 +0530 |
commit | 8b593147c3d890685184fd775157ef84f4df112e (patch) | |
tree | 5fa4974e5782c5c81ca822a8ac5efda616532e88 /ecomp-sdk/epsdk-analytics/src/main | |
parent | 1ba6611803edc1967be99a4660031635b14149dd (diff) |
code smells removed
code smells removed
Issue-ID: PORTAL-813
Change-Id: Ia2148e9d874162b776147c88860a0366071c4ed2
Signed-off-by: Indrijeet Kumar <indriku1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk/epsdk-analytics/src/main')
7 files changed, 22 insertions, 22 deletions
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<String>(); - swingLayers = new ArrayList<SwingLayer>(); + 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<String,NodeInfo> hashMap = node.getNodeCollection().getNodeCollection(); Set set = hashMap.entrySet(); int width = map.getShapeWidth(); - ArrayList<String> visibleLabel = new ArrayList<String>(151); + ArrayList<String> 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<String, XSSFCellStyle> hashMapStyles = new HashMap<String, XSSFCellStyle>();; - Map<String, XSSFFont> hashMapFonts = new HashMap<String, XSSFFont>(); + Map<String, XSSFCellStyle> hashMapStyles = new HashMap<>();; + Map<String, XSSFFont> 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<String, Short> dateFormatMap = new HashMap<String, Short>(); + HashMap<String, Short> 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<QuickLink> quickLinksArray = new ArrayList<QuickLink>(ds.getRowCount()); + ArrayList<QuickLink> 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<String, HashMap<String, String>> dataSeriesMap = new HashMap<String, HashMap<String, String>>(); + HashMap<String, HashMap<String, String>> 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<String> dateStrList = new TreeSet<String>(); + TreeSet<String> dateStrList = new TreeSet<>(); // added to store all date elements - SortedSet<String> sortSet = new TreeSet<String>(); + SortedSet<String> 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<String, String> dataMap = dataSeriesMap.get((String)uniqueElements[i]); Set<String> keySet = dataMap.keySet(); - ArrayList<String> keySortedList = new ArrayList<String>(new TreeSet<String>(keySet)); + ArrayList<String> keySortedList = new ArrayList<>(new TreeSet<String>(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<String> colorList = new TreeSet<String>(); + TreeSet<String> 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<String> dateStrList = new TreeSet<String>(); + TreeSet<String> dateStrList = new TreeSet<>(); // added to store all date elements - SortedSet<String> sortSet = new TreeSet<String>(); + SortedSet<String> 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<DataColumnType> dcList = reportRuntime.getOnlyVisibleColumns(); int countIndex = 0; - ArrayList<ChartColumnJSON> chartColumnJSONList = new ArrayList<ChartColumnJSON>(); + ArrayList<ChartColumnJSON> 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<RangeAxisJSON> rangeAxisJSONList = new ArrayList<RangeAxisJSON>(); + ArrayList<RangeAxisJSON> 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<ArrayList<Row>> wholeList = new ArrayList<ArrayList<Row>>(); + ArrayList<ArrayList<Row>> wholeList = new ArrayList<>(); - ArrayList<Row> rowList = new ArrayList<Row>(); + ArrayList<Row> rowList = new ArrayList<>(); if(showData) { for (int i = 0; i < ds.getRowCount(); i++) { - rowList = new ArrayList<Row>(); + rowList = new ArrayList<>(); for (int j = 0; j<ds.getColumnCount(); j++) { Row row = new Row(); row.setColId(ds.getColumnName(j)); diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java index 73387b20..558f5f71 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ReportRuntime.java @@ -949,7 +949,7 @@ public class ReportRuntime extends ReportWrapper implements Cloneable, Serializa //Collections.sort((List)dataList, new DataRowComparable()); DataRow drInFor1 = null; Vector<DataValue> v1= null, v2 = null; - ArrayList<String> temp = new ArrayList<String>(); + ArrayList<String> temp = new ArrayList<>(); if (Globals.getMergeCrosstabRowHeadings()) { for (int i = 0; i < dataList.size(); i++) { drInFor1 = (DataRow)dataList.get(i); |