Commons CSV
  1. Commons CSV
  2. CSV-118

CSVRecord.toMap() throws NPE on formats with no headers.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.0
    • Fix Version/s: 1.0
    • Component/s: Parser
    • Labels:
    • Environment:

      JUNIT

      Description

      The method toMap() on CSVRecord throws a NullPointerExcpetion when called on records derived using a format with no headers.

      The method documentation states a null map should be returned instead.

      1. csv.patch
        2 kB
        Enrique Lara

        Activity

        Enrique Lara created issue -
        Hide
        Enrique Lara added a comment -

        Patch to main code as well as unit test exposing condition.

        Show
        Enrique Lara added a comment - Patch to main code as well as unit test exposing condition.
        Enrique Lara made changes -
        Field Original Value New Value
        Attachment csv.patch [ 12644954 ]
        Hide
        Gary Gregory added a comment -
        commit -m "<action issue="CSV-118" type="fix" dev="ggregory" due-to="Enrique Lara">CSVRecord.toMap() throws NPE on formats with no headers.</action>" C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVRecordTest.java C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVRecord.java C:/vcs/svn/apache/commons/trunks-proper/csv/src/changes/changes.xml
            Sending        C:/vcs/svn/apache/commons/trunks-proper/csv/src/changes/changes.xml
            Sending        C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVRecord.java
            Sending        C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVRecordTest.java
            Transmitting file data ...
            Committed revision 1594966.
        
        Show
        Gary Gregory added a comment - commit -m "<action issue="CSV-118" type="fix" dev="ggregory" due-to="Enrique Lara">CSVRecord.toMap() throws NPE on formats with no headers.</action>" C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVRecordTest.java C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVRecord.java C:/vcs/svn/apache/commons/trunks-proper/csv/src/changes/changes.xml Sending C:/vcs/svn/apache/commons/trunks-proper/csv/src/changes/changes.xml Sending C:/vcs/svn/apache/commons/trunks-proper/csv/src/main/java/org/apache/commons/csv/CSVRecord.java Sending C:/vcs/svn/apache/commons/trunks-proper/csv/src/test/java/org/apache/commons/csv/CSVRecordTest.java Transmitting file data ... Committed revision 1594966.
        Gary Gregory made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.0 [ 12320161 ]
        Fix Version/s Patch Needed [ 12326831 ]
        Resolution Fixed [ 1 ]
        Benedikt Ritter made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        13h 27m 1 Gary Gregory 15/May/14 16:27
        Resolved Resolved Closed Closed
        91d 3h 39m 1 Benedikt Ritter 14/Aug/14 20:06

          People

          • Assignee:
            Unassigned
            Reporter:
            Enrique Lara
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development