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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    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

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment