From ec7bb7e0c9d085e20bae603ff67e33f3aef0af7a Mon Sep 17 00:00:00 2001 From: Indrijeet kumar Date: Thu, 7 May 2020 09:24:11 +0530 Subject: lowered some code smells lowered some code smells Issue-ID: PORTAL-813 Change-Id: Ie1a8136d352d267b8a452a3d33ddd3d544be23c0 Signed-off-by: Indrijeet Kumar --- .../main/java/org/onap/portalsdk/analytics/util/Utils.java | 11 +++++++---- .../onap/portalsdk/analytics/xmlobj/ChartDrillOptions.java | 2 +- .../org/onap/portalsdk/analytics/xmlobj/ColFilterList.java | 2 +- .../onap/portalsdk/analytics/xmlobj/DashboardEditorList.java | 2 +- .../org/onap/portalsdk/analytics/xmlobj/DashboardReports.java | 2 +- .../onap/portalsdk/analytics/xmlobj/DashboardReportsNew.java | 2 +- .../org/onap/portalsdk/analytics/xmlobj/DataColumnList.java | 2 +- 7 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Utils.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Utils.java index 416fbab7..16d6a899 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Utils.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/util/Utils.java @@ -246,7 +246,7 @@ public class Utils extends org.onap.portalsdk.analytics.RaptorObject { Vector allUsers = AppUtils.getAllUsers(query,param, isAdmin); Vector result = new Vector(allUsers.size()); - List resultLatest = new ArrayList(); + List resultLatest = new ArrayList<>(); for (Iterator iter = allUsers.iterator(); iter.hasNext();) { IdNameValue value = (IdNameValue) iter.next(); @@ -282,7 +282,7 @@ public class Utils extends org.onap.portalsdk.analytics.RaptorObject { Vector allRoles = AppUtils.getAllRoles(query, param, isAdmin); Vector result = new Vector(allRoles.size()); - List resultLatest = new ArrayList(); + List resultLatest = new ArrayList<>(); for (Iterator iter = allRoles.iterator(); iter.hasNext();) { IdNameValue value = (IdNameValue) iter.next(); @@ -357,11 +357,14 @@ public class Utils extends org.onap.portalsdk.analytics.RaptorObject { int numberOfTimesLooped = 0; boolean isSorted = false; SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); - Date date1 = null, date2 = null; + Date date1 = null; + Date date2 = null; Date currDate = new Date(); Object[] matchingfileNamesArr = matchingFiles.toArray(); //System.out.println("SIZE " + matchingFiles.size()); - String fileName1 = "", fileName2 =""; + String fileName1 = ""; + String fileName2 =""; + do { isSorted = true; for (int j = 1; j < matchingfileNamesArr.length - numberOfTimesLooped++; j++) { diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ChartDrillOptions.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ChartDrillOptions.java index de8593a8..dfe91132 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ChartDrillOptions.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ChartDrillOptions.java @@ -217,7 +217,7 @@ public class ChartDrillOptions { */ public List getTargetFormfield() { if (targetFormfield == null) { - targetFormfield = new ArrayList(); + targetFormfield = new ArrayList<>(); } return this.targetFormfield; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ColFilterList.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ColFilterList.java index 6a56d590..18cb0075 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ColFilterList.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/ColFilterList.java @@ -104,7 +104,7 @@ public class ColFilterList { */ public List getColFilter() { if (colFilter == null) { - colFilter = new ArrayList(); + colFilter = new ArrayList<>(); } return this.colFilter; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardEditorList.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardEditorList.java index b2b105f5..577b896c 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardEditorList.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardEditorList.java @@ -104,7 +104,7 @@ public class DashboardEditorList { */ public List getEditorList() { if (editorList == null) { - editorList = new ArrayList(); + editorList = new ArrayList<>(); } return this.editorList; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReports.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReports.java index b4ef7389..8f1f1d2f 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReports.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReports.java @@ -104,7 +104,7 @@ public class DashboardReports { */ public List getReportsList() { if (reportsList == null) { - reportsList = new ArrayList(); + reportsList = new ArrayList<>(); } return this.reportsList; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReportsNew.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReportsNew.java index 3eadf6f5..849aa651 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReportsNew.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DashboardReportsNew.java @@ -110,7 +110,7 @@ public class DashboardReportsNew { */ public List getReportsList() { if (reportsList == null) { - reportsList = new ArrayList(); + reportsList = new ArrayList<>(); } return this.reportsList; } diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java index dffce0e9..4d9ba5d9 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/xmlobj/DataColumnList.java @@ -106,7 +106,7 @@ public class DataColumnList { */ public List getDataColumn() { if (dataColumn == null) { - dataColumn = new ArrayList(); + dataColumn = new ArrayList<>(); } return this.dataColumn; } -- cgit 1.2.3-korg