commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Woonsan Ko (JIRA)" <>
Subject [jira] [Updated] (JEXL-144) Empty array property setting fails
Date Thu, 07 Nov 2013 03:39:17 GMT


Woonsan Ko updated JEXL-144:

    Attachment: jexl3-empty-array-patch-4.txt


I'm attaching new patches (jexl2-empty-array-patch-4.txt for 2.0 branch and jexl3-empty-array-patch-4.txt
for trunk).

These improve PropertySetExecutor class not to introduce a new member variable any more. Instead,
it resolves the array component type when executing the setter method. This doesn't make any
difference in performance now because the array component type resolution is done only once

I also considered improving Uberspect instead as mentioned before, but that approach has to
introduce a new EmptyArrayPropertySetExecutor, which doesn't seem to be really simple and
nice to me.

Therefore, I decided to improve the PropertySetExecutor only, not to have a new property there.

Could you please review the new patches?



> Empty array property setting fails
> ----------------------------------
>                 Key: JEXL-144
>                 URL:
>             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-3.txt, jexl2-empty-array-patch-4.txt,
jexl2-empty-array-patch.txt, jexl3-empty-array-patch-2.txt, jexl3-empty-array-patch-3.txt,
jexl3-empty-array-patch-4.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

View raw message