Buggy code:
@ Controller @ RequestMapping ( GDEViewNameConstants . INTERNAL ) public class EligoController extends AbstractBaseController { @ Autowired private FeaturePermissionService featurePermissionService ; @ Autowired private UserRoleService userRoleService ; @ Autowired private ApplicationDataService applicationDataService ; @ Autowired private BaseService baseService ; @ Autowired private EligoServiceClient eligoServiceClient ; @ Autowired private RegistrationEligoTestDetailsService testDetailsService ; @ Autowired private AssessmentCentreTestDetailsService assessmentCentreTestDetailsService ; @ RequestMapping ( REGISTARTION_ELIGO ) public final ModelAndView generateApplicationListingReport ( final HttpServletRequest request , HttpServletResponse response , final Model model , final Locale locale , @ ModelAttribute ( REGISTRATION_ELIGO_FORM ) final RegistrationEligoDto registrationEligoDto , final BindingResult result ) { } private void updateRegEligoTestDetailsObjfromDto ( final RegistrationEligoTestDetails registrationEligoTestDetails , final RegistrationEligoDto registrationEligoDto ) { } @ RequestMapping ( "//exportEligoExcel" ) public final void downloadExcel ( final HttpServletRequest request , final HttpServletResponse response , final Model model , final Locale locale , @ ModelAttribute ( REGISTRATION_ELIGO_FORM ) final RegistrationEligoDto registrationEligoDto , final BindingResult result ) { } @ SuppressWarnings ( "resource" ) private void createEligoExportExcel ( final List < RegistrationEligoDto > dtoList , final HttpServletResponse response ) { } private String getColumnDataFromDto ( final RegistrationEligoDto dto , final int columnIndex ) { } @ SuppressWarnings ( "resource" ) private void validateEligoExcel ( final HttpServletResponse response , final RegistrationEligoDto eligoDto ) { } private int validateEligoExcelImportData ( final Row row , final HSSFSheet errorSheet , final Integer rowNumber , final int errorRowCount ) { } private void writeToErrorExcel ( final Row errorRow , final Integer rowNumber , final String message ) { } private boolean validateEligoGDEComments2 ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoResponse ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoContractSent ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoDecision ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoFurtherConsiderations ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoInterviewComments ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoInterviewScore ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoGameComments ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoGameScore ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoExamComments ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoExamScore ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoGermanTest ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoGDEComments ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoStatus ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoACDate ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoInvitedToAC ( final Row row , final RegistrationEligoDto dto ) { } private boolean validateEligoUserId ( final Row row , final RegistrationEligoDto dto ) { } private boolean checkColumnNames ( final Row row ) { } private void addDataValidationsInExcel ( final HSSFSheet sheet , final int noOFDataRows ) { } @ RequestMapping ( AC_TEST_DATA ) <START_BUG> public final ModelAndView generateACDataReport ( final HttpServletRequest request , final HttpServletResponse response , final Model model , final Locale locale , @ ModelAttribute ( AC_TEST_DATA_FORM ) <END_BUG> final RegistrationEligoDto registrationEligoDto , final BindingResult result ) { GdeUser loggedUser = GDESessionFacade . getUser ( request ) ; model . addAttribute ( TAB_LIST , featurePermissionService . getAllFeaturePermissionsByRole ( userRoleService . fetchUserRoleEnumList ( loggedUser ) ) ) ; model . addAttribute ( SELECTED_TAB , ELIGO_TEST ) ; if ( "saveACResultData" . equals ( registrationEligoDto . getActionType ( ) ) ) { AssessmentCentreTestDetails asCentreTestDetails = assessmentCentreTestDetailsService . load ( registrationEligoDto . getAssessmentTestDetailsID ( ) ) ; updateAssessmentCentreTestDetailsObjFromDto ( asCentreTestDetails , registrationEligoDto ) ; assessmentCentreTestDetailsService . saveOrrMerge ( asCentreTestDetails ) ; } else if ( "importExcel" . equals ( registrationEligoDto . getActionType ( ) ) ) { validateEligoExcel ( response , registrationEligoDto ) ; } else if ( "refreshTestData" . equals ( registrationEligoDto . getActionType ( ) ) ) { if ( ( request . getParameterValues ( "selectedUserIds" ) ) != null ) { List < String > selectedUserIdList = Arrays . asList ( request . getParameterValues ( "selectedUserIds" ) ) ; eligoServiceClient . refreshTestData ( selectedUserIdList ) ; } } else if ( "downloadExcel" . equals ( registrationEligoDto . getActionType ( ) ) ) { try { DocumentInfo documentInfo = new DocumentInfo ( ) ; documentInfo . setId ( 0L ) ; documentInfo . setFilePath ( registrationEligoDto . getFilePath ( ) ) ; response = GDEFileUtil . downloadAFile ( response , documentInfo ) ; } catch ( IOException e ) { throw new GDEException ( e ) ; } return null ; } if ( ( registrationEligoDto . getCurrentPage ( ) ) == null ) { registrationEligoDto . setCurrentPage ( DEFAULT_CURRENT_PAGE ) ; } if ( ( registrationEligoDto . getNoOfRecords ( ) ) == null ) { registrationEligoDto . setNoOfRecords ( DEFAULT_NO_OF_RECORDS_ALL_APPLICATION ) ; } if ( StringUtils . isEmpty ( registrationEligoDto . getSortParameter ( ) ) ) { registrationEligoDto . setSortParameter ( DEFAULT_SORT_PARAM_ALL_APPLICATOPN ) ; } if ( ( registrationEligoDto . getIsAscending ( ) ) == null ) { registrationEligoDto . setIsAscending ( false ) ; } PaginationDataDTO paginationDataDTO = new PaginationDataDTO ( registrationEligoDto ) ; List < RegistrationEligoDto > dtoList = ( ( List < RegistrationEligoDto > ) ( applicationDataService . getACTestData ( paginationDataDTO , registrationEligoDto , locale ) ) ) ; model . addAttribute ( "acTestDataList" , dtoList ) ; model . addAttribute ( "headerList" , ACDataHeaderEnum . valuesAsList ( ) ) ; model . addAttribute ( "germanTestDropDown" , getBaseService ( ) . getEligoGermanTestEnumMap ( locale ) ) ; model . addAttribute ( "decisionDropDown" , getBaseService ( ) . getEligoDecisionEnumMap ( locale ) ) ; model . addAttribute ( "responseDropDown" , getBaseService ( ) . getEligoResponseEnumMap ( locale ) ) ; Integer noOfPages = getNoOfPages ( paginationDataDTO . getAllRecordsCount ( ) , registrationEligoDto . getNoOfRecords ( ) ) ;

Fix:
public final ModelAndView generateACDataReport ( final HttpServletRequest request , HttpServletResponse response , final Model model , final Locale locale , @ ModelAttribute ( AC_TEST_DATA_FORM )