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

The example code in the docs of Closure class regarding OWNER_ONLY resolution strategy is wrong

    XMLWordPrintableJSON

Details

    Description

      In the docs of Closure (groovy.lang.Closure), for the resolution strategy OWNER_ONLY, the example code is wrong.
      The line def cl =

      { y = x + y }

      should be def cl =

      { y = x + y + z}

      which would throw the exception as mentioned later in the example. The current example runs fine without exception and hence does not explain the concept correctly.

      Attachments

        Activity

          People

            paulk Paul King
            shailendra Shailendra Verma
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: