diff options
author | Sunder Tattavarada <statta@research.att.com> | 2019-06-17 15:44:43 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-06-17 15:44:43 +0000 |
commit | 218d7467e56fc8dc8ae8ba07acafbd577a6c5551 (patch) | |
tree | cbae4a263ac198e2090cb981e5849cb1348b1055 /ecomp-sdk | |
parent | 1234f9e506aa08fb7a812af3de4f27c6636dc805 (diff) | |
parent | 2d7b0d8a2c72e6b8254a5beb0386c4292ac95053 (diff) |
Merge "Fix sonar issues in ChartWebRuntime"
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java index fcb0541e..361f405d 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java @@ -70,7 +70,7 @@ public class ChartWebRuntime implements Serializable { public final String QRY_DATA_REPORT = ""; // Not used planning to use when filter is used - private StringBuffer whereClause = new StringBuffer(""); + private StringBuilder whereClause = new StringBuilder(""); // request used to grab request parameters private HttpServletRequest request; @@ -79,11 +79,11 @@ public class ChartWebRuntime implements Serializable { public ReportData reportData; //Used to pass user information - private final Map<String, Object> params = new HashMap<String, Object>(); + private final Map<String, Object> params = new HashMap<>(); //from chart generator retrieves list of charts to render - public ArrayList chartList; - public ArrayList infoList; + public List chartList; + public List infoList; private String totalSql; @@ -94,8 +94,6 @@ public class ChartWebRuntime implements Serializable { public List getRolesCommaSeperated(HttpServletRequest request) { Map roles = UserUtils.getRoles(request); List roleList = null; -// StringBuffer roleBuf = new StringBuffer(""); - int count = 0; if( roles != null ) { roleList = Arrays.asList(roles.keySet().toArray()); } @@ -119,7 +117,7 @@ public class ChartWebRuntime implements Serializable { long currentTime = System.currentTimeMillis(); HttpSession session = request.getSession(); String action = nvl(request.getParameter(AppConstants.RI_ACTION), request.getParameter("action")); - boolean genReportData = (!action.equals("chart.json") || action.equals("chart.data.json")); + boolean genReportData = (!"chart.json".equals(action) || "chart.data.json".equals(action)); @@ -165,7 +163,7 @@ public class ChartWebRuntime implements Serializable { reportData = getReportData(); - HashMap<String, String> chartOptionsMap = new HashMap<String, String>(); + HashMap<String, String> chartOptionsMap = new HashMap<>(); String rotateLabelsStr = ""; rotateLabelsStr = AppUtils.nvl(reportRuntime.getLegendLabelAngle()); @@ -244,11 +242,11 @@ public class ChartWebRuntime implements Serializable { if(reportRuntime!=null) { - StringBuffer title = new StringBuffer(""); + StringBuilder title = new StringBuilder(""); title.append(reportRuntime.getReportName()); } - if(! (action.equals("chart.json") || action.equals("chart.data.json"))) { + if(! ("chart.json".equals(action) || "chart.data.json".equals(action))) { //Chart @@ -328,28 +326,28 @@ public class ChartWebRuntime implements Serializable { /** * @return the chartList */ - public ArrayList getChartList() { + public List getChartList() { return chartList; } /** * @param chartList the chartList to set */ - public void setChartList(ArrayList chartList) { + public void setChartList(List chartList) { this.chartList = chartList; } /** * @return the infoList */ - public ArrayList getInfoList() { + public List getInfoList() { return infoList; } /** * @param infoList the infoList to set */ - public void setInfoList(ArrayList infoList) { + public void setInfoList(List infoList) { this.infoList = infoList; } @@ -408,7 +406,7 @@ public class ChartWebRuntime implements Serializable { } */ - public String drawD3Charts(HashMap<String,String> chartOptionsMap, HttpServletRequest request) { + public String drawD3Charts(Map<String,String> chartOptionsMap, HttpServletRequest request) { ChartD3Helper chartHelper = new ChartD3Helper(reportRuntime); chartHelper.setChartType(reportRuntime.getChartType()); |