[ https://issues.apache.org/jira/browse/CSV-265?focusedWorklogId=622607&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-622607 ]
ASF GitHub Bot logged work on CSV-265: -------------------------------------- Author: ASF GitHub Bot Created on: 14/Jul/21 17:14 Start Date: 14/Jul/21 17:14 Worklog Time Spent: 10m Work Description: king-tyler commented on pull request #120: URL: https://github.com/apache/commons-csv/pull/120#issuecomment-880066930 @garydgregory I rebased on master -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 622607) Time Spent: 50m (was: 40m) > CSV comments break CSVRecord#getCharacterPosition > ------------------------------------------------- > > Key: CSV-265 > URL: https://issues.apache.org/jira/browse/CSV-265 > Project: Commons CSV > Issue Type: Bug > Components: Parser > Affects Versions: 1.8 > Reporter: Tyler King > Priority: Major > Time Spent: 50m > Remaining Estimate: 0h > > The CSVRecord#getCharacterPosition method returns an incorrect value after > the CSVParser has encountered a comment in the CSV file. > Example: > > {code:java} > String csv = "# Comment\n" > + "Headers,Header2\n" > + "Value1,Value2\n"; > CSVFormat format = > CSVFormat.EXCEL.withCommentMarker('#').withFirstRecordAsHeader(); > CSVParser parser = new CSVParser(new StringReader(csv), format); > long expectedPosition = csv.indexOf("Value1"); > long actualPosition = parser.iterator().next().getCharacterPosition(); > assertEquals(expectedPosition, actualPosition);{code} > -- This message was sent by Atlassian Jira (v8.3.4#803005)