[
https://issues.apache.org/jira/browse/SANDBOX-283?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Bob Smith updated SANDBOX-283:
------------------------------
Attachment: CSVParser_SingleValueFix.patch
I attached a patch with one possible fix and some test cases for this
situation.
Instead of just copying the code from getLine to nextValue, I thought it might
be a good idea to move as much code that is common between the two methods into
another shared method. That's what I included in the patch, but the simple fix
would also work fine.
> CSVParser.nextValue() does not handle a CSV file with a single value correctly
> ------------------------------------------------------------------------------
>
> Key: SANDBOX-283
> URL: https://issues.apache.org/jira/browse/SANDBOX-283
> Project: Commons Sandbox
> Issue Type: Bug
> Components: CSV
> Affects Versions: Nightly Builds
> Reporter: Bob Smith
> Priority: Minor
> Attachments: CSVParser_SingleValueFix.patch
>
>
> For a CSV file with a single value in it (like if your entire file is just
> "test"), CSVParser.nextValue() returns null the first time it is called
> instead of the value.
> CSVParser.getLine() and CSVParser.getAllValues() do not value this problem.
> The problem seems to be that getLine() has special handling for the "TT_EOF"
> tokens that nextValue() does not have.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.