Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5730

array given spreaded to doCall method if EMC is enabled

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • 1.8.8, 2.0.4
    • 2.0.5, 1.8.9
    • None
    • None

    Description

      ExpandoMetaClass.enableGlobally()
      Object[] item = [1]
      def cl = {assert it.class == Object[]}
      cl(item)

      The code above fails, the item array is given to the doCall method as if it was spread. The reason is that if ClosureMetaClass is active we invoke the doCall metho, but EMC uses call(Object[]) here. Since call(Object[]) basically just makes a call to doCall with the arguments spread, we get the wrong result above. Without EMC it is working of course.

      This issue is strongly related to http://jira.grails.org/browse/GRAILS-9443. The issue there surfaced because of the introduction of BooleanClosureWrapper, but the issue described here is the underlaying problem to the other issue.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: