I have the feeling that this if / else should be reorganized, but I'm not sure what I can do, or I just have to let it be what it is ...
private String someReportUrl(HttpServletRequest request, HttpServletResponse response) { String url; if (isBackToReportsSummary(request)) { url = SUMMARY_PAGE; getReportsSummary(request, response); } else if (isComingFromPageA(request)) { url = getTabUrl(request, REPORT_URL_FOR_PAGE_A); } else { url = "/standAlone/reportUrl.jsp"; } return url; }
Basically, I have a report summary page that lists three to four reports. Firstly, if the condition is when the user wants to return to this page, the second condition refers to when the user selected this particular report, and the third condition to when the user selects this report as a separate report (and not from summary page)
source share