commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bjoern Voigt (JIRA)" <>
Subject [jira] Created: (SANDBOX-313) Endless loops in CSV parser
Date Mon, 21 Sep 2009 19:59:15 GMT
Endless loops in CSV parser

                 Key: SANDBOX-313
             Project: Commons Sandbox
          Issue Type: Bug
          Components: CSV
    Affects Versions: Nightly Builds
            Reporter: Bjoern Voigt

If the input file ends with comment lines, the parser runs into an endless loop. The example
shows, that the CSV parser runs into an endless loop, if the input is one comment line. '#'
is the comment character here:

import org.apache.commons.csv.CSVStrategy;
import org.apache.commons.csv.CSVParser;

public class TestCSV {
    public static void main(String [] args) throws IOException {
        CSVStrategy strategy=new CSVStrategy(',','"','#','\\',false,false,false,false);
        CSVParser parser = new CSVParser(new StringReader("# A, B\n"), strategy);
        System.out.println("Go into an endless loop...");
        String []line=parser.getLine();

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message