From 97dcf05fde56dc97ac0cc55e7a807d8ab7e2c08a Mon Sep 17 00:00:00 2001 From: Todd Lipcon Date: Mon, 7 Mar 2011 03:16:27 +0000 Subject: [PATCH] HADOOP-7131. Exceptions thrown by Text methods should include the causing exception. Contributed by Uma Maheswara Rao G. git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1078660 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 3 +++ src/java/org/apache/hadoop/io/Text.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 9943913de80..65283af5abd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -94,6 +94,9 @@ Trunk (unreleased changes) HADOOP-7098. Tasktracker property not set in conf/hadoop-env.sh. (Bernd Fondermann via tomwhite) + HADOOP-7131. Exceptions thrown by Text methods should include the causing + exception. (Uma Maheswara Rao G via todd) + Release 0.22.0 - Unreleased INCOMPATIBLE CHANGES diff --git a/src/java/org/apache/hadoop/io/Text.java b/src/java/org/apache/hadoop/io/Text.java index 3f50e845603..f0470ae4d99 100644 --- a/src/java/org/apache/hadoop/io/Text.java +++ b/src/java/org/apache/hadoop/io/Text.java @@ -195,7 +195,7 @@ public class Text extends BinaryComparable bytes = bb.array(); length = bb.limit(); }catch(CharacterCodingException e) { - throw new RuntimeException("Should not have happened " + e.toString()); + throw new RuntimeException("Should not have happened ", e); } } @@ -269,7 +269,7 @@ public class Text extends BinaryComparable try { return decode(bytes, 0, length); } catch (CharacterCodingException e) { - throw new RuntimeException("Should not have happened " + e.toString()); + throw new RuntimeException("Should not have happened " , e); } }