The JEP object has been created correctly and the
parseExpression() method has parsed the expression
succesfully. I then use the getValueAsObject() method
to evaluate the expression multiple times with
different variable values. I have a custom function and
this works ok. The expressions get evaluated correctly
a couple of times, but then a null value is passed and
my custom function throws a NullPointerException. After
that the getValueAsObject() always return null, even if
the variable is set to non-null values. If I skip the
evaluation of null values the expression is correctly
evaluated every time.
I think the simplest solution would be a way to clear
the error list before calling getValueAsObject(). I
looked at the code and I think that maybe checking the
error list is not needed. The expression should always
be evaluated unless the expression couldn't be parsed
and the topNode variable should be null in case the
expression couldn't be parsed?
Log in to post a comment.