[ 
https://issues.apache.org/jira/browse/JEXL-144?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Woonsan Ko updated JEXL-144:
----------------------------

    Attachment: jexl3-empty-array-patch-2.txt
                jexl2-empty-array-patch-2.txt

Hi Sebb,

That's a good point! My initial patch just chose the first found one, but I 
don't think it was quite right.

So, I'm uploading new patches (jexl2-empty-array-patch-2.txt for 2.0 branch and 
jexl3-empty-array-patch-2.txt for trunk), which now fails to find the setter 
method if there's an ambiguity due to the overloaded setter methods.
JEXL can now report the following exception message in that case:
"'quux.arr2 = [  ];' unknown, ambiguous or inaccessible property arr2"

In summary, JEXL can now set an empty array if there's only one setter method 
with the property name and array type parameter, but it fails and reports the 
ambiguity if there are any other overloaded methods.
I think this should be fine.

Please review those.

Cheers,

Woonsan

> Empty array property setting fails
> ----------------------------------
>
>                 Key: JEXL-144
>                 URL: https://issues.apache.org/jira/browse/JEXL-144
>             Project: Commons JEXL
>          Issue Type: Bug
>            Reporter: Woonsan Ko
>             Fix For: 2.1.2, 3.0
>
>         Attachments: jexl2-empty-array-patch-2.txt, 
> jexl2-empty-array-patch.txt, jexl3-empty-array-patch-2.txt, 
> jexl3-empty-array-patch.txt
>
>
> Suppose a bean has an array property setter method (e.g, public void 
> setStrarr(String []) ).
> If I use an expression like this with an empty array, then it fails with the 
> error message, "inaccessible or unknown property strarr".
>   // example expression
>   bean.strarr = [ ];



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to