Buggy code:
cell . setCellValue ( UtilityFunction . getObjectString ( ar . getArhmamt ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getVatflag ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getVatid ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getWhtflag ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getWhtid ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getBasewhtamt ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getBasewhthmamt ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getWhtamt ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getWhthmamt ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getYear ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getPeriod ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getNote ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesaccount1 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesdivision1 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesproject1 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSalesamt1 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSaleshmamt1 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesaccount2 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesdivision2 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesproject2 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSalesamt2 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSaleshmamt2 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesaccount3 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesdivision3 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getSalesproject3 ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSalesamt3 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( UtilityFunction . getObjectString ( ar . getSaleshmamt3 ( ) ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getService ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getAraccount ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getPrefix ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getDocumentno ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getArtrans ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getCust_taxid ( ) ) ; cell = dataRow . createCell ( ( cellnum ++ ) ) ; <START_BUG> cell . setCellValue ( ar . getCust_branch ( ) ) ; <END_BUG> cell = dataRow . createCell ( ( cellnum ++ ) ) ; cell . setCellValue ( ar . getCompany_branch ( ) ) ; } FileOutputStream out = new FileOutputStream ( new File ( ( fullFileName + ".xls" ) ) ) ; workbook . write ( out ) ; out . close ( ) ; status = "success" ; } catch ( Exception e ) { e . printStackTrace ( ) ; for ( ARNirvana ar : ARList ) { if ( ! ( "" . equals ( status ) ) ) { status += ",<seq2seq4repair_space>" ; } status += ar . getReceive_detail_id ( ) ; } } return status ; } @ Override public String UpdateStatusARInterface ( List < ARNirvana > APList ) { } public SessionFactory getSessionFactory ( ) { } public void setSessionFactory ( SessionFactory sessionFactory ) { } public void setTransaction ( Transaction transaction ) { } public Transaction getTransaction ( ) { } private List < ARNirvana > SearchArNirvanaFromPaymentDetailId ( List < ARNirvana > ARList ) { } }

Fix:
cell . setCellValue ( ( ( ar . getCust_branch ( ) ) == null ? "" : ar . getCust_branch ( ) . toString ( ) ) ) ;