Buggy code:
public class exportHandler < T extends ULCComponent & IRichDialogPanel > { private ProgressMessage returnedMessage ; private T ulcPane = null ; private static File exportedExcel ; private static String outputPath ; private static String outputName ; private static String fullPath ; public exportHandler ( final T _ulcPane ) { } public exportHandler ( ) { } public static File transformTable2Excel ( RTable _table , String _sheetName ) { exportHandler . outputPath = exportHandler . formatPathWithEndSeparator ( "" ) ; exportHandler . outputName = exportHandler . getFileNameWithoutExt ( ( ( _sheetName + "_export-" ) + ( System . nanoTime ( ) ) ) ) ; if ( _table == null ) { return exportHandler . exportedExcel ; } exportHandler . fullPath = ( ( exportHandler . outputPath ) + ( exportHandler . outputName ) ) + ".xls" ; int x = _table . getColumnCount ( ) ; int y = _table . getRowCount ( ) ; try { String [ ] heads = new String [ x ] ; for ( int i = 0 ; i < x ; i ++ ) { try { if ( ( _table . getColumnName ( i ) ) == null ) { heads [ i ] = "" ; } else { heads [ i ] = _table . getColumnModel ( ) . getColumn ( i ) . getHeaderValue ( ) . toString ( ) ; } } catch ( NullPointerException ex ) { heads [ i ] = "" ; } } HSSFWorkbook wb = new HSSFWorkbook ( ) ; FileOutputStream fileOut ; HSSFSheet sheet = wb . createSheet ( _sheetName ) ; HSSFCellStyle cs = wb . createCellStyle ( ) ; HSSFCellStyle csDate = wb . createCellStyle ( ) ; cs . setWrapText ( true ) ; csDate . setDataFormat ( ( ( short ) ( 14 ) ) ) ; HSSFRow row = sheet . createRow ( ( ( short ) ( 0 ) ) ) ; for ( int i = 0 ; i < ( heads . length ) ; i ++ ) { HSSFCell cell = row . createCell ( i ) ; cell . setCellValue ( new HSSFRichTextString ( heads [ i ] . toString ( ) ) ) ; } for ( int i = 0 ; i < y ; i ++ ) { HSSFRow r = sheet . createRow ( ( ( ( short ) ( i ) ) + 1 ) ) ; for ( int j = 0 ; j < x ; j ++ ) { HSSFCell cell ; Object o ; o = _table . getValueAt ( i , j ) ; if ( o instanceof String ) { try { o = Double . parseDouble ( ( ( String ) ( o ) ) ) ; } catch ( NumberFormatException e ) { } } if ( o instanceof Number ) { cell = r . createCell ( j , CELL_TYPE_NUMERIC ) ; cell . setCellValue ( ( ( Number ) ( o ) ) . doubleValue ( ) ) ; cell . setCellStyle ( cs ) ; } else if ( o instanceof Date ) { cell = r . createCell ( j , CELL_TYPE_NUMERIC ) ; <START_BUG> cell . setCellValue ( ( ( Date ) ( o ) ) . toDate ( ) ) ; <END_BUG> cell . setCellStyle ( csDate ) ; } else if ( o instanceof java . util . Date ) { cell = r . createCell ( j , CELL_TYPE_NUMERIC ) ; cell . setCellValue ( ( ( java . util . Date ) ( o ) ) ) ; cell . setCellStyle ( csDate ) ; } else { cell = r . createCell ( j ) ; cell . setCellValue ( new HSSFRichTextString ( o . toString ( ) ) ) ; cell . setCellStyle ( cs ) ; } } } for ( short i = 0 ; i < x ; i ++ ) { sheet . autoSizeColumn ( i , false ) ; } fileOut = new FileOutputStream ( exportHandler . fullPath ) ; wb . write ( fileOut ) ; fileOut . close ( ) ; exportHandler . exportedExcel = new File ( exportHandler . fullPath ) ; exportHandler . outputPath = exportHandler . exportedExcel . getAbsolutePath ( ) . substring ( 0 , exportHandler . exportedExcel . getAbsolutePath ( ) . lastIndexOf ( File . separator ) ) ; Ivy . log ( ) . warn ( exportHandler . outputPath ) ; } catch ( FileNotFoundException e ) { Ivy . log ( ) . error ( ( "FileNotFoundException<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; e . printStackTrace ( ) ; } catch ( IOException e ) { Ivy . log ( ) . error ( ( "IOException<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; e . printStackTrace ( ) ; } catch ( Exception e ) { Ivy . log ( ) . error ( ( "Exception<seq2seq4repair_space>" + ( e . getMessage ( ) ) ) ) ; e . printStackTrace ( ) ; } return exportHandler . exportedExcel ; } public ProgressMessage export ( final File file ) { } private static String formatPathWithEndSeparator ( String path ) { } private static String getFileNameWithoutExt ( String fileName ) { } private String formatServerPath ( String path ) { } }

Fix:
cell . setCellValue ( ( ( Date ) ( o ) ) . toJavaDate ( ) ) ;