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] [Updated] (CSV-150) Escaping is not disableable
Date Fri, 03 Apr 2015 10:27:52 GMT

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

Benedikt Ritter updated CSV-150:
--------------------------------
    Fix Version/s: Review

> Escaping is not disableable
> ---------------------------
>
>                 Key: CSV-150
>                 URL: https://issues.apache.org/jira/browse/CSV-150
>             Project: Commons CSV
>          Issue Type: Bug
>          Components: Parser
>    Affects Versions: 1.1
>            Reporter: Georg Tsakumagos
>             Fix For: Review
>
>
> h6. Problem
> If escaping is disabled the Lexer maps the NULL Character to the magic char  '\ufffe'.
 I currently hit this char randomly with data. This leads to a RuntimeException inside of
org.apache.commons.csv.Lexer.parseEncapsulatedToken(Token) with the message "invalid char
between encapsulated token and delimiter". 
> h6. Solution
> Don't map the Character object and use it. 
> {code:title=Lexer.java|borderStyle=solid}
>     Lexer(final CSVFormat format, final ExtendedBufferedReader reader) {
>         this.reader = reader;
>         this.delimiter = format.getDelimiter();
>         this.escape = format.getEscapeCharacter();
>         .
>         .
>         .
>     }
>     boolean isEscape(final int ch) {
>         return null != this.escape && escape.charValue() == ch;
>     }
> {code}
> h6. Hint
> This pattern is used in other cases to. It seem to be a systematic error. This cases
should be refactored also.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message