Buggy code:
sheet = wb_hssf . getSheetAt ( 0 ) ; } int rowNum = ( sheet . getLastRowNum ( ) ) + 1 ; int colNum = sheet . getRow ( 0 ) . getLastCellNum ( ) ; logger . info ( ( ( ( "rowNum,colNum<seq2seq4repair_space>" + rowNum ) + '<seq2seq4repair_space>' ) + colNum ) ) ; int y = 0 ; double selfreq = 0 ; ArrayList < Double > freqarr = new ArrayList < Double > ( ) ; if ( fileExtn . equalsIgnoreCase ( "xlsx" ) ) { XSSFRow freqrow = ( ( XSSFRow ) ( sheet . getRow ( 1 ) ) ) ; for ( int u = 1 ; u < colNum ; u ++ ) { freqarr . add ( Double . parseDouble ( freqrow . getCell ( u ) . toString ( ) ) ) ; } for ( y = 0 ; y < ( freqlist . size ( ) ) ; y ++ ) { double colfreq = 0 ; selfreq = freqlist . get ( y ) . getFrequency ( ) ; colfreq = ClosetFreq ( selfreq , freqarr ) ; for ( int i = 0 ; i < rowNum ; i ++ ) { if ( i > 1 ) { XSSFRow row = ( ( XSSFRow ) ( sheet . getRow ( i ) ) ) ; String amplitude ; if ( ( row . getCell ( 0 ) ) != null ) { for ( int u = 1 ; u < colNum ; u ++ ) { if ( ( Double . parseDouble ( freqrow . getCell ( u ) . toString ( ) ) ) == colfreq ) { DataLog datalog = new DataLog ( ) ; datalog . setFreq ( selfreq ) ; datalog . setAngle ( Double . parseDouble ( row . getCell ( 0 ) . toString ( ) ) ) ; amplitude = row . getCell ( u ) . toString ( ) ; datalog . setAmplitude ( Double . parseDouble ( amplitude ) ) ; datalogList . add ( datalog ) ; break ; } } } } } } } else { logger . info ( "inside<seq2seq4repair_space>xls" ) ; logger . info ( ( "file.getFrequnit()<seq2seq4repair_space>" + ( file . getFrequnit ( ) ) ) ) ; HSSFRow freqrow = ( ( HSSFRow ) ( sheet . getRow ( 1 ) ) ) ; for ( int u = 1 ; u < colNum ; u ++ ) { freqarr . add ( Double . parseDouble ( freqrow . getCell ( u ) . toString ( ) ) ) ; } logger . info ( ( "freqlist.size()<seq2seq4repair_space>" + ( freqlist . size ( ) ) ) ) ; for ( y = 0 ; y < ( freqlist . size ( ) ) ; y ++ ) { double colfreq = 0 ; selfreq = freqlist . get ( y ) . getFrequency ( ) ; colfreq = ClosetFreq ( selfreq , freqarr ) ; for ( int i = 0 ; i < rowNum ; i ++ ) { if ( i > 1 ) { HSSFRow row = ( ( HSSFRow ) ( sheet . getRow ( i ) ) ) ; String amplitude ; if ( ( row . getCell ( 0 ) ) != null ) { for ( int u = 1 ; u < colNum ; u ++ ) { if ( ( Double . parseDouble ( freqrow . getCell ( u ) . toString ( ) ) ) == colfreq ) { DataLog datalog = new DataLog ( ) ; datalog . setFreq ( selfreq ) ; datalog . setAngle ( Double . parseDouble ( row . getCell ( 0 ) . toString ( ) ) ) ; amplitude = row . getCell ( u ) . toString ( ) ; datalog . setAmplitude ( Double . parseDouble ( amplitude ) ) ; datalogList . add ( datalog ) ; break ; } } } } } } } inp . close ( ) ; logger . info ( ( "<seq2seq4repair_space>datalogList.size<seq2seq4repair_space>" + ( datalogList . size ( ) ) ) ) ; if ( ( datalogList . size ( ) ) > 0 ) { testid = mastersservice . insertTestData ( file , freqlist , datalogList , strmode , action ) ; } request . setAttribute ( "message" , "File<seq2seq4repair_space>Uploaded<seq2seq4repair_space>Successfully" ) ; } catch ( Exception ex ) { err = "File<seq2seq4repair_space>Upload<seq2seq4repair_space>Failed<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" + ex ; request . setAttribute ( "message" , ( "File<seq2seq4repair_space>Upload<seq2seq4repair_space>Failed<seq2seq4repair_space>due<seq2seq4repair_space>to<seq2seq4repair_space>" + ex ) ) ; logger . info ( ( "Inside<seq2seq4repair_space>FileUpload<seq2seq4repair_space>Controller<seq2seq4repair_space>Exception<seq2seq4repair_space>" + ( ex . getMessage ( ) ) ) ) ; } logger . info ( ( "<seq2seq4repair_space>imported<seq2seq4repair_space>testid<seq2seq4repair_space>" + ( testid ) ) ) ; } } request . setAttribute ( "id" , null ) ; cursess . setAttribute ( "id" , null ) ; request . setAttribute ( "mode" , null ) ; cursess . setAttribute ( "mode" , null ) ; if ( action . equals ( "More" ) ) { return new ModelAndView ( new RedirectView ( ( "testimport.htm?id=" + ( testid ) ) ) ) ; } else if ( action . equals ( "Done" ) ) <START_BUG> return new ModelAndView ( "fileuploadresult" , "fileName" , ( ( fileName + "<seq2seq4repair_space>" ) + ( err ) ) ) ; <END_BUG> else return new ModelAndView ( new RedirectView ( ( ( "testimport.htm?id=" + ( testid ) ) + "&mode=edit" ) ) ) ; } @ Override protected void initBinder ( HttpServletRequest request , ServletRequestDataBinder binder ) throws ServletException { } private static String GetFileExtension ( String fname2 ) { } protected Object formBackingObject ( HttpServletRequest request ) throws ServletException { } protected HashMap referenceData ( HttpServletRequest request ) throws Exception { } public void setMastersManager ( MastersService mastersservice ) { } public MastersService getMastersManager ( ) { } private double ClosetFreq ( double myNumber , ArrayList < Double > numbers ) { } }

Fix:
return new ModelAndView ( "fileuploadresult" , "fileName" , ( ( "<seq2seq4repair_space>" + "<seq2seq4repair_space>" ) + ( err ) ) ) ;