[
https://issues.apache.org/jira/browse/ODFTOOLKIT-325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Florian Hopf updated ODFTOOLKIT-325:
------------------------------------
Attachment: testcase-fix-ODFTOOLKIT-325.patch
As the OdfTableCell is deprecated there doesn't seem much sense in fixing this.
However, the same problem occurs for the Simple API. Attached is a test for
time and date values and a fix.
> Spreadsheet : Call to cell.getTimeValue on cell marked as valueType TIME but
> no value set gives NPE
> ----------------------------------------------------------------------------------------------------
>
> Key: ODFTOOLKIT-325
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-325
> Project: ODF Toolkit
> Issue Type: Bug
> Components: odfdom
> Affects Versions: 0.8.7
> Environment: Linux, JDK1.6
> Reporter: Andy Jefferson
> Attachments: testcase-fix-ODFTOOLKIT-325.patch
>
>
> Create a spreadsheet with a cell. Call
> cell.setValueType(OfficeValueTypeAttribute.Value.TIME.toString());
> then call
> cell.getTimeValue();
> gives
> java.lang.NullPointerException
> at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1234)
> at java.text.DateFormat.parse(DateFormat.java:335)
> at
> org.odftoolkit.odfdom.doc.table.OdfTableCell.parseString(OdfTableCell.java:920)
> at
> org.odftoolkit.odfdom.doc.table.OdfTableCell.getTimeValue(OdfTableCell.java:886)
> I'd expect null if no value is set. Blowing its brains out is not considered
> a reasonable reply.
> The same thing using DATE valueType doesn't cause this AFAIK
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira