It looks like your trying to evaluate an expression "null * 0.0" the
exception is being raised in the com.singularsys.jep.functions.Multiply
(*) function which does not know how to multiply by null. This does seem
to be the correct behaviour.
The internal type checking of many functions has changed and they now
typically throw IllegalParameterException rather than
EvaluationException. The former is a subclass of the latter so existing
code should work.
I'm not quite sure why your getting changes between 3.2 and 3.3 here.
Rich
--
Richard Morris
Web: www.singsurf.org www.pfaf.org
Email: ri...@singsurf.org
Tel: (+44) 01208 872963
Post: 1 Lerryn View, Lerryn, Lostwithiel, Cornwall, PL22 0QJ
Thinking about this I wonder what the preferred behaviour for null would
be. In a database or spreadsheet application the behaviour for
arithmetic seems to be that any operation using null results in a null
result so "null * 0" would be null. Is this what you would like?
Likewise, still getting into the swing of the new year.
> I believe in the 3.2 version if I try and multiply null * anything I
> would get null back. Now in 3.3 I am getting an exception which is
> going to force me to make a code change to handle the exception. I
> would prefer just to get a null result back to set back to my data
> set. This is what version 3.2 does using the StandardEvaluator.
> Because I am explicitly calling setTrapNullValues(false) I would
> expect to be able to pass in null arguments and have the expression be
> evaluated appropriately.
>
> -Eric
I'm working on a solution to the problem at the moment. Its not really a
problem with the evaluator more with the individual functions. To solve
it I've created wrapper functions which test for null values on input
and return null if found, otherwise they use the wrapped function for
evaluation. Most but not all functions want this behaviour. I'm still
working on the code at the moment but its not fully tested yet.
I've not been able to reproduce the null * anything == null behaviour in
the 3.2.
Rich
--
Richard Morris
Web: www.singsurf.org www.pfaf.org
Email: ri...@singsurf.org