Buggy code:
@ Controller @ RequestMapping ( GDEViewNameConstants . INTERNAL ) public class AllApplicationController extends AbstractBaseController { @ Autowired private ApplicationDataService applicationDataService ; @ Autowired private DocumentInfoService documentInfoService ; @ Autowired private FeaturePermissionService featurePermissionService ; @ Autowired private DeleteRequestDetailService deleteRequestDetailService ; @ Autowired private UserRoleService userRoleService ; @ Autowired private UserService userService ; @ Autowired private CandidateDataController candidateDataController ; @ Autowired private MailService mailService ; @ RequestMapping ( ALL_APPLICATION_VIEW_WITH_SLASH ) public final ModelAndView getAllApplicationData ( final HttpServletRequest httpServletRequest , HttpServletResponse httpServletResponse , final Model model , @ ModelAttribute ( ALL_APPLICATION_FORM ) final ApplicationDataDto allApplicationDataDtoObj , final BindingResult result , final Locale locale ) throws CycleMasterDataException { String homeView = ALL_APPLICATION_VIEW ; if ( null != ( GDESessionFacade . getAttribute ( httpServletRequest , ALL_APPLICATION_FILTER_MODAL ) ) ) { allApplicationDataDtoObj . setFilterDto ( ( ( AllApplicationFilterDto ) ( GDESessionFacade . getAttribute ( httpServletRequest , ALL_APPLICATION_FILTER_MODAL ) ) ) ) ; } if ( ( ( httpServletRequest . getAttribute ( "filterCheckBox" ) ) == null ) && ( GDEStringUtils . isNullOrEmpty ( allApplicationDataDtoObj . getActionType ( ) ) ) ) { allApplicationDataDtoObj . getFilterDto ( ) . setFilter ( false ) ; } String readOnlyAppView = ( null != ( httpServletRequest . getParameter ( "readOnlyAppView" ) ) ) ? httpServletRequest . getParameter ( "readOnlyAppView" ) : null ; GdeUser loggedUser = GDESessionFacade . getUser ( httpServletRequest ) ; model . addAttribute ( TAB_LIST , featurePermissionService . getAllFeaturePermissionsByRole ( userRoleService . fetchUserRoleEnumList ( loggedUser ) ) ) ; model . addAttribute ( SELECTED_TAB , ALL_APPLICATION ) ; model . addAttribute ( "onDeleteMessage" , getMessageSource ( ) . getMessage ( "on.delete.message" , null , locale ) ) ; if ( DOWNLOAD_ALL_DOC . equals ( allApplicationDataDtoObj . getActionType ( ) ) ) { homeView = ALL_APPLICATION_VIEW ; GdeUser obj = new GdeUser ( ) ; obj . setId ( allApplicationDataDtoObj . getUserid ( ) ) ; ArrayList < DocumentInfo > objList = ( ( ArrayList < DocumentInfo > ) ( documentInfoService . getListofDocumentInfo ( obj ) ) ) ; obj = userService . getUserDetails ( obj . getId ( ) ) ; try { httpServletResponse = GDEFileUtil . generateZipFileApplication ( httpServletResponse , obj , objList ) ; } catch ( IOException e ) { throw new GDEException ( e ) ; } return null ; } else if ( ( EDIT_APPLICATION . equals ( allApplicationDataDtoObj . getActionType ( ) ) ) || ( VIEW_APPLICATION . equals ( allApplicationDataDtoObj . getActionType ( ) ) ) ) { GdeUser appUser = userService . getUserDetails ( allApplicationDataDtoObj . getUserid ( ) ) ; GDESessionFacade . setAttribute ( httpServletRequest , "appUser" , appUser ) ; GDESessionFacade . setAttribute ( httpServletRequest , "readOnlyAppView" , readOnlyAppView ) ; return new ModelAndView ( GDEStringUtils . concat ( REDIRECT , APPLICANT_VIEW_WITH_SLASH ) ) ; } else if ( DELETE_APPLICATION . equals ( allApplicationDataDtoObj . getActionType ( ) ) ) { GdeUser appUser = userService . getUserDetails ( allApplicationDataDtoObj . getUserid ( ) ) ; deleteRequestDetailService . deleteUserApplication ( appUser , allApplicationDataDtoObj ) ; <START_BUG> return new ModelAndView ( homeView ) ; <END_BUG> } else { if ( ( allApplicationDataDtoObj . getCurrentPage ( ) ) == null ) { allApplicationDataDtoObj . setCurrentPage ( DEFAULT_CURRENT_PAGE ) ; } if ( ( allApplicationDataDtoObj . getNoOfRecords ( ) ) == null ) { allApplicationDataDtoObj . setNoOfRecords ( DEFAULT_NO_OF_RECORDS ) ; } if ( StringUtils . isEmpty ( allApplicationDataDtoObj . getSortParameter ( ) ) ) { allApplicationDataDtoObj . setSortParameter ( "userid" ) ; } if ( ( allApplicationDataDtoObj . getIsAscending ( ) ) == null ) { allApplicationDataDtoObj . setIsAscending ( false ) ; } PaginationDataDTO paginationDataDTO = new PaginationDataDTO ( allApplicationDataDtoObj ) ; ArrayList < ApplicationDataDto > objApplicationDataDtoList = ( ( ArrayList < ApplicationDataDto > ) ( applicationDataService . getApplicationDataList ( allApplicationDataDtoObj , paginationDataDTO , locale ) ) ) ; model . addAttribute ( "objApplicationDataDtoList" , objApplicationDataDtoList ) ; Integer noOfPages = getNoOfPages ( paginationDataDTO . getAllRecordsCount ( ) , allApplicationDataDtoObj . getNoOfRecords ( ) ) ; UiPaginationDto paginationDto = new UiPaginationDto ( allApplicationDataDtoObj . getCurrentPage ( ) , noOfPages , ALL_APPLICATION_VIEW ) ; model . addAttribute ( "totalRecordCount" , paginationDataDTO . getAllRecordsCount ( ) ) ; model . addAttribute ( "paginationDto" , paginationDto ) ; model . addAttribute ( ALL_APPLICATION_FORM , allApplicationDataDtoObj ) ; model . addAttribute ( ALL_APPLICATION_STATUS , RoleEnum . valuesAsList ( ) ) ; model . addAttribute ( ON_CANCEL_MESSAGE , getMessageSource ( ) . getMessage ( "on.cancel.message" , null , locale ) ) ; AllApplicationFilterDto allApplicationFilterDto = ( ( AllApplicationFilterDto ) ( httpServletRequest . getSession ( ) . getAttribute ( ALL_APPLICATION_FILTER_MODAL ) ) ) ; if ( ( null != allApplicationFilterDto ) && ( null != ( httpServletRequest . getAttribute ( "filterCheckBox" ) ) ) ) { allApplicationFilterDto . setFilter ( Boolean . TRUE ) ; } else if ( null == allApplicationFilterDto ) { allApplicationFilterDto = new AllApplicationFilterDto ( ) ; allApplicationFilterDto . setFilter ( Boolean . FALSE ) ; } else if ( ( ( httpServletRequest . getAttribute ( "filterCheckBox" ) ) == null ) && ( GDEStringUtils . isNullOrEmpty ( allApplicationDataDtoObj . getActionType ( ) ) ) ) { allApplicationFilterDto . setFilter ( Boolean . FALSE ) ; } model . addAttribute ( ALL_APPLICATION_FILTER_MODAL , httpServletRequest . getSession ( ) . getAttribute ( ALL_APPLICATION_FILTER_MODAL ) ) ; return new ModelAndView ( homeView ) ; } } @ RequestMapping ( APPLICATION_LISTING_REPORT ) public ModelAndView generateApplicationListingReport ( final HttpServletRequest request , final HttpServletResponse response , final Model model , final Locale locale ) { } @ RequestMapping ( ALL_APPLICATION_FILTER_VIEW_WITH_SLASH ) public final void getFilteredApplicationData ( final HttpServletRequest httpServletRequest , final HttpServletResponse httpServletResponse , final Model model , @ ModelAttribute ( ALL_APPLICATION_FILTER_MODAL ) final AllApplicationFilterDto allApplicationFilterDto , final BindingResult result , final Locale locale ) throws CycleMasterDataException , IOException , ServletException { } }

Fix:
return new ModelAndView ( GDEStringUtils . concat ( REDIRECT , homeView ) ) ;