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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7
    • 1.8
    • None
    • 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

        Issue Links

          Activity

            People

              Unassigned Unassigned
              aherbert Alex Herbert
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

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