[jira] [Commented] (JEXL-259) Shorter ant-ish variables prevent longer ant-ish variables from being resolved properly

2019-12-24 Thread Dmitri Blinov (Jira)


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

Dmitri Blinov commented on JEXL-259:


I ditched the ant-ish variables and have managed to write cascade resolver that 
resolves one part after another. That was not a generic solution for all cases, 
but was just enough for my use-case.

> 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
> Fix For: 3.1
>
>
> 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
(v8.3.4#803005)


[jira] [Commented] (JEXL-259) Shorter ant-ish variables prevent longer ant-ish variables from being resolved properly

2019-12-24 Thread sdhalex (Jira)


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

sdhalex commented on JEXL-259:
--

[~dmitri_blinov] can u tell me, how did u do this by workaround ?  And one and 
a half year has passed, is there any real improvement to this issue? [~henrib]

> 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
> Fix For: 3.1
>
>
> 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
(v8.3.4#803005)


[jira] [Commented] (JEXL-259) Shorter ant-ish variables prevent longer ant-ish variables from being resolved properly

2018-04-30 Thread Dmitri Blinov (JIRA)

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

Dmitri Blinov commented on JEXL-259:


I understand the difficulty of the resolving dotted names that can clash with 
properties of the objects themselves, since as I think, Jexl is an interpreted 
scripting language, and should process access operators one by one, without 
peeping over what would come next in chain. But something needs to be done with 
that, because to my mind, clashing of the multi-levelled names is natural for 
people to put their thoughts in order, I think there are many examples like 
system property names {{java.vendor}} and {{java.vendor.url}} to name a few. If 
you see a reliable way to improve the ant-ish variable detection, my opinion is 
that definitely needs to be done, and I'm ready to jump in and test whatever I 
can. Without that I would be left with the only choice of abandoning ant-ish 
variables altogether in favour of something like a recursive cascading 
resolver, which is like an old  dirty hack 

> 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)


[jira] [Commented] (JEXL-259) Shorter ant-ish variables prevent longer ant-ish variables from being resolved properly

2018-04-29 Thread Henri Biestro (JIRA)

[ 
https://issues.apache.org/jira/browse/JEXL-259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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)