The GitHub Actions job "Java CI with Gradle" on poi.git/date-serial-range has 
failed.
Run started by GitHub user pjfanning (triggered by pjfanning).

Head commit for run:
e3f468927d6797d4a320584905c144775fbe2cba / PJ Fanning 
<[email protected]>
A date serial past 9999-12-31 is not a valid Excel date: no exception from 
DataFormatter, null from DateUtil

DateUtil.isValidExcelDate only rejected negative serials, so a date-formatted
cell holding anything from 2^31 up reached MathUtil.safeDoubleToInt in
DateUtil.getJavaCalendar: DataFormatter.formatCellValue and 
Cell.getDateCellValue
threw IllegalArgumentException, while DateUtil.getLocalDateTime silently
truncated the serial through BigDecimal.intValue (1E10 became the year 3862607,
1E308 became 1899-12-31). Excel's dates end at serial 2958465 (9999-12-31) and 
it
displays a date-formatted cell outside that range as ########.

- isValidExcelDate also requires the serial to be below MAX_EXCEL_DATE_SERIAL + 
1,
  so getJavaDate/getJavaCalendar/getLocalDateTime return null for it, as they
  already did for a negative serial, and isCellDateFormatted is false
- DataFormatter shows such a value as a plain number in the General format
  instead of pushing the raw double through the date format as milliseconds
  since 1970 (a negative value used to come out as "1970-01-01 00:59:59", or
  "-1.0" when the pattern-derived format happened not to be cached). The check
  sits before the format cache, so a number format built from a date pattern is
  no longer cached under that pattern and applied to valid dates formatted 
later.
- the csv emulation keeps its 255 #s for such values

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

Report URL: https://github.com/apache/poi/actions/runs/35360945517

With regards,
GitHub Actions via GitBox


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to