[ https://issues.apache.org/jira/browse/HADOOP-13192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15327187#comment-15327187 ]
ASF GitHub Bot commented on HADOOP-13192: ----------------------------------------- GitHub user zhudebin opened a pull request: https://github.com/apache/hadoop/pull/99 HADOOP-13192. org.apache.hadoop.util.LineReader match recordDelimiter has a bug fix bug HADOOP-13192 org.apache.hadoop.util.LineReader match recordDelimiter has a bug You can merge this pull request into a Git repository by running: $ git pull https://github.com/zhudebin/hadoop trunk Alternatively you can review and apply these changes as the patch at: https://github.com/apache/hadoop/pull/99.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #99 ---- commit 9a2d0f197747c4f10ff89a8e2e7ca0712e94b608 Author: zhudebin <zdb...@163.com> Date: 2016-06-13T11:15:00Z HADOOP-13192 org.apache.hadoop.util.LineReader match recordDelimiter has a bug ---- > org.apache.hadoop.util.LineReader match recordDelimiter has a bug > ------------------------------------------------------------------ > > Key: HADOOP-13192 > URL: https://issues.apache.org/jira/browse/HADOOP-13192 > Project: Hadoop Common > Issue Type: Bug > Components: util > Affects Versions: 2.6.2 > Reporter: binde > Original Estimate: 5m > Remaining Estimate: 5m > > org.apache.hadoop.util.LineReader.readCustomLine() has a bug, > when line is aaaabccc, recordDelimiter is aaab, the result should be a,ccc, > show the code on line 310: > for (; bufferPosn < bufferLength; ++bufferPosn) { > if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) { > delPosn++; > if (delPosn >= recordDelimiterBytes.length) { > bufferPosn++; > break; > } > } else if (delPosn != 0) { > bufferPosn--; > delPosn = 0; > } > } > shoud be : > for (; bufferPosn < bufferLength; ++bufferPosn) { > if (buffer[bufferPosn] == recordDelimiterBytes[delPosn]) { > delPosn++; > if (delPosn >= recordDelimiterBytes.length) { > bufferPosn++; > break; > } > } else if (delPosn != 0) { > // ------------- change here ------------- start ---- > bufferPosn -= delPosn; > // ------------- change here ------------- end ---- > > delPosn = 0; > } > } -- This message was sent by Atlassian JIRA (v6.3.4#6332) --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org