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

Invoker.asIterator() does not check for metaclass methods when trying to create an Iterator for an object

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-JSR-6
    • 1.0-RC-1
    • groovy-jdk
    • None

    Description

      When calling one of the methods .each(), .find() etc. the runtime tries to determine whether an iterator can be created for the object in question. This happens in Invoker.asIterator(Object). If none of the special cases holds, the object class is examined for the method iterator().

      Instead the meta class should be examined. This allows to add an iterator via a Category.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jbaumann Joachim Baumann
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: