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

Improve GDK Reference File.eachLine and File.eachFile

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.7.0
    • None
    • None

    Description

      It would be helpful if the parameters that are passed to the closures for the different each* methods would be better documented, maybe in a semi.formal way. In the case of Reader.eachLine and File.eachLine it looks like not only the line itself is passed to the closure but also the line number(oddly the line number seems to be one-based and not zero-based like everything else in Groovy/Java/Computer Science).
      To get this information right now someone needs to look at:
      http://svn.groovy.codehaus.org/browse/~raw,r=12115/groovy/trunk/groovy/groovy-core/src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java

      Similarly the documentation for File.eachFileResurse and others could be improved by stating if both (real) files and directories or only one of those two are passed to the closure.

      Maybe a general convention for documenting closure parameters could be setup.

      Attachments

        Activity

          People

            paulk Paul King
            ttest ttest
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: