commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CSV-36) Endless loops in CSV parser
Date Thu, 14 Aug 2014 20:08:29 GMT

     [ https://issues.apache.org/jira/browse/CSV-36?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Benedikt Ritter closed CSV-36.
------------------------------


> Endless loops in CSV parser
> ---------------------------
>
>                 Key: CSV-36
>                 URL: https://issues.apache.org/jira/browse/CSV-36
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>            Reporter: Bjoern Voigt
>             Fix For: 1.0
>
>         Attachments: apache-csv-endlessloop-fix.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> 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:
> {noformat}
> import org.apache.commons.csv.CSVStrategy;
> import org.apache.commons.csv.CSVParser;
> import java.io.StringReader;
> import java.io.IOException;
> 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();
>     }
> }
> {noformat} 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message