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

A single empty header is allowed when not allowing empty column headers.

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.8
    • Component/s: None
    • Labels:
      None

      Description

      If the settings are not allowing empty columns headers you can currently use a single empty header. This is because column headers are only checked for empty when they are duplicates. So it is the second empty header (the first duplicate) that raises an error. This test should pass but does not:

      @Test(expected = IllegalArgumentException.class)
      public void testHeadersMissingOneColumnException() throws Exception {
          final Reader in = new StringReader("a,,c,d\n1,2,3,4\nx,y,z,zz");    CSVFormat.DEFAULT.withHeader().parse(in).iterator(); 
      }
      

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              aherbert Alex Herbert

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

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

                  Issue deployment