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

CSVRecord inconsistent behaviour when header mapping is not found

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      The CSVRecord#get(String) method has inconsistent behaviour.

      If no header mapping was provided, then it throws IllegalStateException.
      If the header name is not found, null is returned.

      Apart from being inconsistent, it might be useful in the future to be able to return null as a column value (as distinct from the empty string).

      It should throw IllegalArgumentException for a missing header name, instead of returning null.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sebb Sebb
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: