From e7d03636a098675f88bb3907c8ca6a64ea0ca6d8 Mon Sep 17 00:00:00 2001 From: Harsh J Date: Sun, 6 May 2012 11:20:16 +0000 Subject: [PATCH] HADOOP-8323. Revert HADOOP-7940, cause it may cause a performance regression. (harsh) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1334603 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-common-project/hadoop-common/CHANGES.txt | 2 -- .../src/main/java/org/apache/hadoop/io/Text.java | 1 - .../src/test/java/org/apache/hadoop/io/TestText.java | 10 ---------- 3 files changed, 13 deletions(-) diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index 558c9b89625..a97d8787694 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -326,8 +326,6 @@ Release 2.0.0 - UNRELEASED HADOOP-8104. Inconsistent Jackson versions (tucu) - HADOOP-7940. The Text.clear() method does not clear the bytes as intended. (Csaba Miklos via harsh) - HADOOP-8119. Fix javac warnings in TestAuthenticationFilter in hadoop-auth. (szetszwo) diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java index 5c52883ebf5..e38dd3c79a5 100644 --- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java +++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/io/Text.java @@ -239,7 +239,6 @@ public class Text extends BinaryComparable */ public void clear() { length = 0; - bytes = EMPTY_BYTES; } /* diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java index a756a57dae7..a7718bfba70 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/io/TestText.java @@ -192,16 +192,6 @@ public class TestText extends TestCase { assertTrue(text.find("\u20ac", 5)==11); } - public void testClear() { - Text text = new Text(); - assertEquals("", text.toString()); - assertEquals(0, text.getBytes().length); - text = new Text("abcd\u20acbdcd\u20ac"); - text.clear(); - assertEquals("", text.toString()); - assertEquals(0, text.getBytes().length); - } - public void testFindAfterUpdatingContents() throws Exception { Text text = new Text("abcd"); text.set("a".getBytes());