title: SONAR Issue "Method parameters, caught exceptions and foreach variables should not be reassigned"
body: <p>My code did a SONAR scan and I got a major error that said "Method parameters, caught exceptions and foreach variables should not be reassigned". I don't understand how they are being reassigned. Is their a fix for this? I get the error where it says "reportForm = new ReportForm();" in the code below.</p>
  
  <pre><code> public ModelAndView getPcVolumeTopOffendersShortpaid(@Valid @ModelAttribute("reportForm") ReportForm reportForm, BindingResult result) {
      // Handle invalid request date cleanly ...
      // when invalid or doesn't exist, use the current date for selection
      // otherwise, selection is valid and can be used in criteria for query
      if (reportForm == null || result.hasErrors()) {
          reportForm = new ReportForm();
          reportForm.setMonthYear(DateFormatterUtil.getAbbreviatedMonthYearFromCurrentDateTime());
      }
  
      // Create the criteria for the specified, and retrieve the report
      reportForm.setReportType(ReportType.SHORTPAID_TOP_OFFENDERS_BY_VOLUME);
      TopOffendersReportCriteria topOffendersReportCriteria = reportService.getTopOffendersReportCriteria(reportForm);
      List&lt;TopOffendersReport&gt; list = reportService.getTopOffendersReport(topOffendersReportCriteria);
  
      // Return the reports view and the supporting page objects
      ModelAndView mv = new ModelAndView("reports/topOffendersShortpaidVolume");
      mv.addObject("reportList", list);
      mv.addObject("reportForm", reportForm);
      return mv;
  }
  </code></pre>