Uploaded image for project: 'Commons JEXL'
  1. Commons JEXL
  2. JEXL-218

Overloaded JexlArithmetic.empty() method is not called for a class implementing Map interface

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Labels:
      None

      Description

      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

      empty(x)

      or

      size(x)

      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?

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dmitri_blinov Dmitri Blinov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: