From 84b75772152e4585ef1fd722f86ab994b6fce2ef Mon Sep 17 00:00:00 2001 From: Avik Sengupta Date: Mon, 5 May 2003 06:20:28 +0000 Subject: [PATCH] PR 19634: Compiling error in jdk1.3 git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353082 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hssf/record/UnicodeString.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/hssf/record/UnicodeString.java b/src/java/org/apache/poi/hssf/record/UnicodeString.java index 622cd792b1..ad97d25bfa 100644 --- a/src/java/org/apache/poi/hssf/record/UnicodeString.java +++ b/src/java/org/apache/poi/hssf/record/UnicodeString.java @@ -158,7 +158,15 @@ public class UnicodeString field_3_string = new String(data, 3, getCharCount(), StringUtil.getPreferredEncoding()); } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); + // Extract the message out of our encoding + // error and then bubble a runtime exception. + String errorMessage = e.getMessage(); + + // Make sure the message isn't null + if (errorMessage == null) { + errorMessage = e.toString(); + } + throw new RuntimeException(errorMessage); } } else