Author: bayard
Date: Fri Aug 22 00:49:28 2008
New Revision: 688011

URL: http://svn.apache.org/viewvc?rev=688011&view=rev
Log:
Switching from printStackTrace to UnhandledException as per LANG-450

Modified:
    
commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java

Modified: 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
URL: 
http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java?rev=688011&r1=688010&r2=688011&view=diff
==============================================================================
--- 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
 (original)
+++ 
commons/proper/lang/trunk/src/java/org/apache/commons/lang/StringEscapeUtils.java
 Fri Aug 22 00:49:28 2008
@@ -162,8 +162,7 @@
             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 @@
             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 @@
             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 @@
             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 @@
             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 @@
             return writer.toString();
         } catch (IOException ioe) {
             // this should never ever happen while writing to a StringWriter
-            ioe.printStackTrace();
-            return null;
+            throw new UnhandledException(ioe);
         }
     }
 


Reply via email to