Dmitri Blinov created JEXL-218:
----------------------------------

             Summary: Overloaded JexlArithmetic.empty() method is not called 
for a class implementing Map interface
                 Key: JEXL-218
                 URL: https://issues.apache.org/jira/browse/JEXL-218
             Project: Commons JEXL
          Issue Type: Bug
    Affects Versions: 3.0
            Reporter: Dmitri Blinov


Sorry for not providing a test case but this is a rare problem I haven't 
managed to catch. I have a class which implements a {{Map}} interface and I 
have an overloaded {{JexlArithmetic.empty()}} and {{JexlArithmetic.size()}} 
methods for this class, and these methods are *not* related to correspondent 
{{Map.isEmpty()}} and {{Map.size()}} methods, they provide separate semantics 
in my case. Apart from the point that this design is questionable, most of the 
time everything works as expected in jexl, i.e. when {code}empty(x){code} or 
{code}size(x){code} operators are used in scripting, the overloaded 
{{JexlArithmetic.empty()}} and {{JexlArithmetic.size()}} are called. But 
sometimes in rare circumstances these operators are not called and 
{{Map.isEmpty()}} and {{Map.size()}} methods respectively are called instead. I 
suspect this has something to do with operators caching, may be you'll be able 
to check the code?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to