poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Josh Micich <josh.mic...@gmail.com>
Subject Re: Formulas
Date Thu, 22 Jan 2009 02:02:26 GMT
Hello Zach,

> Why can't this be something other than a runtime exception?

Your point is well taken. I have made this change
https://issues.apache.org/bugzilla/show_bug.cgi?id=46580
The new exception (NotImplementedException) is public so you can check for
it specifically, but it is still unchecked thereby not forcing clients of
the evaluator API to handle it.

An example of what the stack trace might look like now:

Exception in thread "main"
org.apache.poi.ss.formula.eval.NotImplementedException: Error evaluating
cell Sheet1!A1
    at
org.apache.poi.ss.formula.WorkbookEvaluator.addExceptionInfo(WorkbookEvaluator.java:254)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:225)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluate(WorkbookEvaluator.java:180)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateFormulaCellValue(HSSFFormulaEvaluator.java:297)
    at
org.apache.poi.hssf.usermodel.HSSFFormulaEvaluator.evaluateInCell(HSSFFormulaEvaluator.java:217)
    at example.poi.TestNotImpl.main(TestPOIPrevVer.java:30)
Caused by: org.apache.poi.ss.formula.eval.NotImplementedException:
org.apache.poi.hssf.record.formula.functions.Datedif
    at
org.apache.poi.hssf.record.formula.functions.NotImplementedFunction.evaluate(NotImplementedFunction.java:42)
    at
org.apache.poi.hssf.record.formula.eval.FuncVarEval.evaluate(FuncVarEval.java:41)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.invokeOperation(WorkbookEvaluator.java:394)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateFormula(WorkbookEvaluator.java:329)
    at
org.apache.poi.ss.formula.WorkbookEvaluator.evaluateAny(WorkbookEvaluator.java:216)
    ... 4 more


regards,
Josh

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message