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

File.eachLine reports line numbers starting with 1, 2,...

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.6, 1.6-beta-1
    • 1.5.7, 1.6-beta-2
    • None
    • None
    • any

    Description

      file.eachLine

      { line, number -> assert number > 0 }

      Programmers would expect the line numbers to start with 0, 1,...

      Furthermore the current behaviour is incompatible with e.g. List.eachWithIndex what makes it difficult to write closures that work in both cases.

      Attachments

        Activity

          People

            paulk Paul King
            veita Alexander Veit
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: