Uploaded image for project: 'Commons CSV'
  1. Commons CSV
  2. CSV-57

CSVParser.getRecords() contract is confusing

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Parser
    • None

    Description

      CSVParser.getRecords() has a confusing contract. It will return all records from the current position instead of all values in the parsed file. This implies that users will first iterate over the records using the iterator and then call getRecords(). This seems like an unlikely use case.

      Also, it is not good practice to return null. So getRecords() should return an empty array, if no records can be found.

      Attachments

        Activity

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

          People

            Unassigned Unassigned
            britter Benedikt Ritter
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment