[jira] Created: (SANDBOX-316) Infinite loop when the last line is a comment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[jira] Created: (SANDBOX-316) Infinite loop when the last line is a comment

Gilles (Jira)
Infinite loop when the last line is a comment
---------------------------------------------

                 Key: SANDBOX-316
                 URL: https://issues.apache.org/jira/browse/SANDBOX-316
             Project: Commons Sandbox
          Issue Type: Bug
          Components: CSV
    Affects Versions: Nightly Builds
         Environment: Linux ubuntu jaunty
            Reporter: Kamel Boulebiar
            Priority: Minor


I try to parse a simple file bl.csv that contains:
-----------------------------------
#The simplest good test
00000000
0001
0000002
00003
0000004
#comment at the end
------------------------------------

I wrote several test and I notice that when the last line is a comment , I get lock in an infinite loop when parsing the file.
This is the only problem I notice, Others basic case work fine.

Below is the parser I have configured:

 CSVStrategy strategy = CSVStrategy.DEFAULT_STRATEGY;
 strategy.setCommentStart('#');
 strategy.setIgnoreEmptyLines(true);
 strategy.setIgnoreLeadingWhitespaces(true);
 CSVParser csvparser = new CSVParser(new FileReader(csvFile), strategy);
 String[][] data = csvparser.getAllValues();



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

Reply | Threaded
Open this post in threaded view
|

[jira] Closed: (SANDBOX-316) Infinite loop when the last line is a comment

Gilles (Jira)

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

Yonik Seeley closed SANDBOX-316.
--------------------------------

    Resolution: Duplicate

> Infinite loop when the last line is a comment
> ---------------------------------------------
>
>                 Key: SANDBOX-316
>                 URL: https://issues.apache.org/jira/browse/SANDBOX-316
>             Project: Commons Sandbox
>          Issue Type: Bug
>          Components: CSV
>    Affects Versions: Nightly Builds
>         Environment: Linux ubuntu jaunty
>            Reporter: Kamel Boulebiar
>            Priority: Minor
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> I try to parse a simple file bl.csv that contains:
> -----------------------------------
> #The simplest good test
> 00000000
> 0001
> 0000002
> 00003
> 0000004
> #comment at the end
> ------------------------------------
> I wrote several test and I notice that when the last line is a comment , I get lock in an infinite loop when parsing the file.
> This is the only problem I notice, Others basic case work fine.
> Below is the parser I have configured:
>  CSVStrategy strategy = CSVStrategy.DEFAULT_STRATEGY;
>  strategy.setCommentStart('#');
>  strategy.setIgnoreEmptyLines(true);
>  strategy.setIgnoreLeadingWhitespaces(true);
>  CSVParser csvparser = new CSVParser(new FileReader(csvFile), strategy);
>  String[][] data = csvparser.getAllValues();

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