[
https://issues.apache.org/jira/browse/JEXL-144?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13814409#comment-13814409
]
Woonsan Ko commented on JEXL-144:
---------------------------------
Hi [~henrib],
Your idea (adding determination code into Uberspect instead of
PropertySetExecutor) seems better.
So, I'd like to ask your opinion on my improvement idea.
In JEXL3, I think I can do the following:
- Improve Uberspect#getPropertySet() to return a separate executor type
instance when the argument is an empty array.
So, I think we can add EmptyArrayPropertySetExecutor by extending
PropertySetExecutor. Its #discover() is used to get an executor instance in
that case. We don't have to keep the member in Executor classes any more.
How does it sound to you?
Also, in the same approach, I think we can improve
Introspector#getSetExecutor() for JEXL2.
If it sounds okay to you, I will post new patches. :-)
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-3.txt, jexl2-empty-array-patch.txt,
> jexl3-empty-array-patch-2.txt, jexl3-empty-array-patch-3.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)