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

Henri Biestro commented on JEXL-259:
------------------------------------

This is the intended behavior; you can not mix antish and property accessed 
variables. If *a.b* resolves as an antish var and returns a non-null object 
(lets call it 'ab'), *a.b.c* must be a property of  'ab'. if this is null, 
*a.b.c.d* is not solvable (note the 'd' here)
.
In general, as soon as an antish var returns a non-null object, the remaining 
expression is expected to be solved as properties. Alternative behaviors would 
be easily inconsistent or unpredictable. Is *a.b.c.* the 'c' property of 'a.b' 
or the antish var *a.b.c* ?

As is, this issue is not a bug; as an improvement, it might be possible to 
detect/flag 'pure' antish references and set/get them through overridable 
method. 

> Shorter ant-ish variables prevent longer ant-ish variables from being 
> resolved properly
> ---------------------------------------------------------------------------------------
>
>                 Key: JEXL-259
>                 URL: https://issues.apache.org/jira/browse/JEXL-259
>             Project: Commons JEXL
>          Issue Type: Bug
>    Affects Versions: 3.1
>            Reporter: Dmitri Blinov
>            Priority: Major
>
> The following script is evaluated successfully
> {code}
> a.b.c = 2; a.b = 1; return a.b
> {code}
> While the following scripts are terminated with error {{unsolvable property 
> 'c'}}
> {code}
> a.b = 1; a.b.c = 2; return a.b
> {code}
> {code}
> a.b.c = 2; a.b = 1; return a.b.c
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to