Skip to content

Can't evaluate single text parameter #54

@buruczky-viktor

Description

@buruczky-viktor

Since the TextNode from the jackson library implements the iterable interface the isEligible method of ArrayLike returns true for that type of parameter. This can cause issues if the only parameter of an unary function is a string.
In PreEvaluatedArgumentsExpression.evaluate, there is this piece of code:

if (values.size() == 1 && ArrayLike.isEligible(values.get(0))) {
  values = new ArrayLike(values.get(0));
}

This will try to turn any TextNode into an ArrayLike using it's iterator() method.
According to the jackson documentation, that will call the elements() method, which in turn returns an empty iterator, so at the end the result will be an empty ArrayLike object.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions