diff options
author | 2020-04-05 19:13:15 +0530 | |
---|---|---|
committer | 2020-04-08 09:29:39 +0000 | |
commit | e92a0523542289590101d588aa0c3303f6ed592c (patch) | |
tree | e294f18a262727f2719aa4aaef3e36848f677069 /ecomp-sdk | |
parent | 4fe4c6992c81e236f16167ce0027ecdc5d837c15 (diff) |
improved code structure
Removed code smells
Issue-ID: PORTAL-865
Change-Id: If444f9d8c1048a4c0696f9bc9d4a124c117e9651
Signed-off-by: Rupinder<rupinsi1@in.ibm.com>
Diffstat (limited to 'ecomp-sdk')
-rw-r--r-- | ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java index b42bdf9c..d77e6bc7 100644 --- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java +++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/pdf/PdfReportHandler.java @@ -1,7 +1,7 @@ /* * ============LICENSE_START========================================== * ONAP Portal SDK - * =================================================================== + * =================================================================== * Copyright © 2017 AT&T Intellectual Property. All rights reserved. * =================================================================== * @@ -10,7 +10,7 @@ * you may not use this software except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -124,7 +124,7 @@ import org.onap.portalsdk.analytics.view.ReportData; import org.onap.portalsdk.analytics.view.RowHeader; import org.onap.portalsdk.analytics.view.RowHeaderCol; import org.onap.portalsdk.analytics.xmlobj.DataColumnType; -import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; +import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; /** * @author mwliu and sundar @@ -161,7 +161,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ int returnValue = 0; ReportRuntime rr = null; - if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); + if(rr==null) + rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); boolean isDashboard = false; if ((request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID)!=null) && ( ((String) request.getSession().getAttribute(AppConstants.SI_DASHBOARD_REP_ID)).equals(rr.getReportID())) ) { @@ -247,17 +248,21 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ //ReportRuntime rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); //ReportData rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); rr = null; - ReportData rd = null; + ReportData rd = null; String parent = ""; int parentFlag = 0; - if(!nvl(request.getParameter("parent"), "").equals("N")) parent = nvl(request.getParameter("parent"), ""); - if(parent.startsWith("parent_")) parentFlag = 1; + if(!nvl(request.getParameter("parent"), "").equals("N")) + parent = nvl(request.getParameter("parent"), ""); + if(parent.startsWith("parent_")) + parentFlag = 1; if(parentFlag == 1) { rr = (ReportRuntime) request.getSession().getAttribute(parent+"_rr"); rd = (ReportData) request.getSession().getAttribute(parent+"_rd"); } - if(rr==null) rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); - if(rd==null) rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); + if(rr==null) + rr = (ReportRuntime) request.getSession().getAttribute(AppConstants.SI_REPORT_RUNTIME); + if(rd==null) + rd = (ReportData) request.getSession().getAttribute(AppConstants.RI_REPORT_DATA); pb = preparePdfBean(request,rr); FONT_FAMILY = rr.getPDFFont(); @@ -738,9 +743,11 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ //System.out.println("chartGroupOrg " + chartGroupOrg); if(nvl(chartGroupOrg).length()>0) tempChartGroupCurrent = chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|")); - if(i>0) tempChartGroupPrev = ((String) lGroups.get(i-1)).substring(0,((String) lGroups.get(i-1)).lastIndexOf("|")); + if(i>0) + tempChartGroupPrev = ((String) lGroups.get(i-1)).substring(0,((String) lGroups.get(i-1)).lastIndexOf("|")); //System.out.println("TEMPCHARTGROUP " + tempChartGroupCurrent + " " + tempChartGroupPrev); - if(tempChartGroupCurrent.equals(tempChartGroupPrev)) continue; + if(tempChartGroupCurrent.equals(tempChartGroupPrev)) + continue; //System.out.println("CHARTGROUPORG " + chartGroupOrg + " " + lGroups) ; //String chartGroup = chartGroupOrg.substring(0,chartGroupOrg.lastIndexOf("|")); String chartGroup = chartGroupOrg; @@ -1422,7 +1429,8 @@ public class PdfReportHandler extends org.onap.portalsdk.analytics.RaptorObject{ DataRow dr = rd.reportDataRows.getNext(); for(dr.resetNext();dr.hasNext();) { DataValue dv = dr.getNext(); - if(!dv.isVisible()) totalVisbleColumn--; + if(!dv.isVisible()) + totalVisbleColumn--; } break; |