Summary: | [DateValue] DATEVALUE should throw an EvaluationException | ||
---|---|---|---|
Product: | POI | Reporter: | Petr Michálek <michalek.petr> |
Component: | SS Common | Assignee: | POI Developers List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | All | ||
Attachments: | Patch to DateValue.java |
The patch is needed, if the DateTimeException is not caught it stops evaluation completely. However I'm not sure that the ErrorEval.NUM_ERROR as suggested in the proposed patch is the right error code to return. My excel (version 2010) returns ErrorEval.VALUE_INVALID. Same for the case where the text argument is blank or an empty string. Also maybe the code can be made simple if we catch the DateTimeException in the existing try block? Can you also provide a small unit-test which verifies this to ensure it stays in-place in the future? |
Created attachment 37754 [details] Patch to DateValue.java In case of wrong input parameters DateValue function breaks formula evaluation. Patch is attached, please review.