From 8b718d2470e99ee65f40dab3de1b53bbe68fe0c5 Mon Sep 17 00:00:00 2001 From: Henri Yandell Date: Fri, 22 Aug 2008 07:49:28 +0000 Subject: [PATCH] Switching from printStackTrace to UnhandledException as per LANG-450 git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@688011 13f79535-47bb-0310-9956-ffa450edef68 --- .../commons/lang/StringEscapeUtils.java | 24 +++++++------------ 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/java/org/apache/commons/lang/StringEscapeUtils.java b/src/java/org/apache/commons/lang/StringEscapeUtils.java index 285bd3fb6..482711f04 100644 --- a/src/java/org/apache/commons/lang/StringEscapeUtils.java +++ b/src/java/org/apache/commons/lang/StringEscapeUtils.java @@ -162,8 +162,7 @@ public class StringEscapeUtils { return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter - ioe.printStackTrace(); - return null; + throw new UnhandledException(ioe); } } @@ -286,8 +285,7 @@ public class StringEscapeUtils { return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter - ioe.printStackTrace(); - return null; + throw new UnhandledException(ioe); } } @@ -461,11 +459,9 @@ public class StringEscapeUtils { StringWriter writer = new StringWriter ((int)(str.length() * 1.5)); escapeHtml(writer, str); return writer.toString(); - } catch (IOException e) { - //assert false; + } catch (IOException ioe) { //should be impossible - e.printStackTrace(); - return null; + throw new UnhandledException(ioe); } } @@ -533,11 +529,9 @@ public class StringEscapeUtils { StringWriter writer = new StringWriter ((int)(str.length() * 1.5)); unescapeHtml(writer, str); return writer.toString(); - } catch (IOException e) { - //assert false; + } catch (IOException ioe) { //should be impossible - e.printStackTrace(); - return null; + throw new UnhandledException(ioe); } } @@ -733,8 +727,7 @@ public class StringEscapeUtils { return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter - ioe.printStackTrace(); - return null; + throw new UnhandledException(ioe); } } @@ -811,8 +804,7 @@ public class StringEscapeUtils { return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter - ioe.printStackTrace(); - return null; + throw new UnhandledException(ioe); } }