You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Cameron Samak (Jira)" <ji...@apache.org> on 2021/06/02 14:26:00 UTC

[jira] [Commented] (JEXL-348) Parsing error when mixing namespaces with conditional expressions

    [ https://issues.apache.org/jira/browse/JEXL-348?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17355767#comment-17355767 ] 

Cameron Samak commented on JEXL-348:
------------------------------------

I just read through the fix for JEXL-346 and I think I understand the issue more now.

As I understand it, to make this parse the namespaces need to be set directly in JexlBuilder or in JexlFeatures.

In that case, is this a known breaking change vs 3.0? To clarify:

{code}new JexlBuilder().create().createExpression("empty(A) ? ns:func() : B").evaluate(context);{code}

works in 3.0 and does not work at HEAD. In 3.0 namespace resolution could happen completely in the JexlContext/JexlContext.NamespaceResolver.

For our upgrade from 3.0 I think we might be able to collect all possible namespace names upfront, but I'm not sure yet. Alternative workarounds include using multiple engines and predicting more namespaces than necessary (would a namespace predicate in JexlFeatures that always returns true break other things?)

> Parsing error when mixing namespaces with conditional expressions
> -----------------------------------------------------------------
>
>                 Key: JEXL-348
>                 URL: https://issues.apache.org/jira/browse/JEXL-348
>             Project: Commons JEXL
>          Issue Type: Bug
>            Reporter: Cameron Samak
>            Assignee: Henri Biestro
>            Priority: Major
>             Fix For: 3.2
>
>
> {code}empty(A) ? ns:func() : B{code}
> results in an unexpected parse error: 1:22 parsing error in ':'
> Tested at HEAD. This seems like it worked in 3.0.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)