You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2013/05/07 17:17:16 UTC

[jira] [Resolved] (CSV-98) Line number counting is confusing

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

Sebb resolved CSV-98.
---------------------

    Resolution: Fixed

Resolved by adjusting the EOL count if reader is currently processing a line and has yet to reach EOL.

Renamed the methods and adjusted the single test case that relied on the odd numbering scheme.

URL: http://svn.apache.org/r1479936
Log:
CSV-98  Line number counting is confusing

Modified:
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVLexer.java
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/CSVParser.java
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/ExtendedBufferedReader.java
    commons/proper/csv/trunk/src/main/java/org/apache/commons/csv/Lexer.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexer1.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexer1306663.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexer1306667.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVLexer3.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/CSVParserTest.java
    commons/proper/csv/trunk/src/test/java/org/apache/commons/csv/ExtendedBufferedReaderTest.java

                
> Line number counting is confusing
> ---------------------------------
>
>                 Key: CSV-98
>                 URL: https://issues.apache.org/jira/browse/CSV-98
>             Project: Commons CSV
>          Issue Type: Bug
>            Reporter: Sebb
>
> The original code counts EOLs only (CR/LF/CRLF), starting from 0.
> Thus the line number stays as 0 until the EOL of the first line is seen.
> This is confusing: if a parsing error is detected before EOL is reached on the first line it will be reported as line 0, whereas if the error is detected after EOL is detected but before any other characters are read it will be reported as line 1. However as far as the user is concerned in both cases the syntax error is in line 1.
> The current line number should start at 0 (when nothing has been processed) and be returned as line 1 from the 1st character read up until the end of the first line.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira