Search before asking
Fesod version
main
JDK version
any
Operating system
Linux
Steps To Reproduce
File file = new File("negative-date.xlsx");
DataFormatData dataFormat = new DataFormatData();
dataFormat.setFormat("yyyy-mm-dd");
WriteCellData<BigDecimal> cell = new WriteCellData<>(new BigDecimal("-1"));
cell.getOrCreateStyle().setDataFormatData(dataFormat);
FesodSheet.write(file)
.head(Collections.singletonList(Collections.singletonList("day")))
.sheet()
.doWrite(Collections.singletonList(Collections.singletonList(cell)));
System.out.println(FesodSheet.read(file).sheet().doReadSync());
Current Behavior
org.apache.fesod.sheet.exception.ExcelDataConvertException
A negative value is not a valid date, so DateUtils.getJavaDate returns null and that null
reaches Format.format. The whole read fails, not just the one cell.
Expected Behavior
Anything else?
Found while writing the tests in #1110.
Are you willing to submit a PR?
Search before asking
Fesod version
main
JDK version
any
Operating system
Linux
Steps To Reproduce
Current Behavior
org.apache.fesod.sheet.exception.ExcelDataConvertExceptionA negative value is not a valid date, so
DateUtils.getJavaDatereturnsnulland thatnullreaches
Format.format. The whole read fails, not just the one cell.Expected Behavior
Anything else?
Found while writing the tests in #1110.
Are you willing to submit a PR?