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

Cannot use "final" modifier on iterator in for (...) loops

    XMLWordPrintableJSON

Details

    Description

      Consider a piece of code like this :

      for ( final Element e : someCollectionOfElement ) {
      //do something with e
      }

      while this compiles with Java, Groovy gives me the following exception

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup.

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            xsautejeau Xavier Sautejeau
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: