commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CSV-70) Improve readability of CSVLexer
Date Sun, 25 Mar 2012 09:16:28 GMT

    [ https://issues.apache.org/jira/browse/CSV-70?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13237807#comment-13237807
] 

Benedikt Ritter commented on CSV-70:
------------------------------------

I have looked at that several times, but I don't know how to remove the recursive call. First
I thought one could just change: 
{code:java}
if (isCommentStart(c)) {
    // ignore everything till end of line and continue (incr linecount)
    in.readLine();
    tkn = nextToken(tkn.reset());
}
{code}
to:
{code:java}
if (isCommentStart(c)) {
    // ignore everything till end of line and continue (incr linecount)
    in.readLine();
    tkn.reset();
    continue;
}
{code}

But that will skip all the empty line processing... Maybe it will be easier to remove that
recursive call once we have split up the parsing logic some more.
                
> Improve readability of CSVLexer
> -------------------------------
>
>                 Key: CSV-70
>                 URL: https://issues.apache.org/jira/browse/CSV-70
>             Project: Commons CSV
>          Issue Type: Improvement
>          Components: Parser
>    Affects Versions: 1.0
>            Reporter: Benedikt Ritter
>             Fix For: 1.0
>
>
> There are several things that can be improved in the token lexer (this has also been
discussed on ML, see http://markmail.org/thread/c6x5ji4v44nx5k4h):
> * Remove Token input parameter in nextToken()
> * Add convenience methods isDelimiter(c) and isEncapsulator(c)
> * Remove current caracter input parameter from methods
> * If possible: replace while(true) loops

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message