summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk
diff options
context:
space:
mode:
authorPawel <pawel.kasperkiewicz@nokia.com>2019-05-23 05:36:31 -0400
committerPawel <pawel.kasperkiewicz@nokia.com>2019-05-23 05:36:31 -0400
commit2d7b0d8a2c72e6b8254a5beb0386c4292ac95053 (patch)
tree126ebf2ea51481e0c1f6f17a2c1180f3dca7f5df /ecomp-sdk
parent68eabf669e4c83bd669286900e8a6f77e4009f29 (diff)
Fix sonar issues in ChartWebRuntime
Issue-ID: PORTAL-589 Signed-off-by: Pawel <pawel.kasperkiewicz@nokia.com> Change-Id: I66daba54fe1557bd268a2dda754142916c6dcd0d
Diffstat (limited to 'ecomp-sdk')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/runtime/ChartWebRuntime.java28
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());