Created attachment 30756 [details] A Xlsx file which has first row formatted with custom format mm/dd/yyyy;;; and contains value 0 DataFormatter.formatCellValue(cell) throws IllegalArgumentException when the format of a cell is is mm/dd/yyyy;;; and value is 0. Actually df.formatCellValue(cell); this API returns correct date for non zero numbers and negative numbers it returns negactive values But for value 0 for some reason it is throwing IllegalArgumentExeption.
Created attachment 30792 [details] Java File for reading excel which gives IllegalArgumentException.
still in 3.10_beta1 but it seems to be the result of the custom format. it ends up in an empty Format String for the zero value. It is mentioned in a comment in the org.apache.poi.ss.usermodel.DataFormatter Class. The comment that it requires refactoring of other code.
Thanks Bodo. We also found a similar issue with the CellFormat. If you try to get the cellformat for three consequtive semicolons then array index out of bound exception observed. CellFormat.getInstance(";;;"); This format is supported by the MS Excel by the way.
In DataFormatter.getFormat() there is some special handling of semicolons which seems to affect this, not sure why this is done this way currently, though, so doesn't seem easy to fix...
There were a few changes to DataFormatter and ;;; formats done after 3.13 was released, would it be possible for someone to retest this with a recent nightly build / recent svn checkout build / 3.14 beta 1 once released?