Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8C9E3200B40 for ; Fri, 17 Jun 2016 05:20:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8B31E160A52; Fri, 17 Jun 2016 03:20:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D5DE7160A51 for ; Fri, 17 Jun 2016 05:20:06 +0200 (CEST) Received: (qmail 33737 invoked by uid 500); 17 Jun 2016 03:20:05 -0000 Mailing-List: contact common-dev-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list common-dev@hadoop.apache.org Received: (qmail 33697 invoked by uid 99); 17 Jun 2016 03:20:05 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 17 Jun 2016 03:20:05 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 4038C2C1F5D for ; Fri, 17 Jun 2016 03:20:05 +0000 (UTC) Date: Fri, 17 Jun 2016 03:20:05 +0000 (UTC) From: "binde (JIRA)" To: common-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (HADOOP-13192) org.apache.hadoop.util.LineReader match recordDelimiter has a bug MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 17 Jun 2016 03:20:07 -0000 [ https://issues.apache.org/jira/browse/HADOOP-13192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] binde resolved HADOOP-13192. ---------------------------- Resolution: Fixed add a test case > 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-dev-unsubscribe@hadoop.apache.org For additional commands, e-mail: common-dev-help@hadoop.apache.org