commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r796078 - in /commons/proper/lang/trunk/src: java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java test/org/apache/commons/lang/ClassUtilsTest.java
Date Mon, 20 Jul 2009 23:55:31 GMT
Author: bayard
Date: Mon Jul 20 23:55:30 2009
New Revision: 796078

URL: http://svn.apache.org/viewvc?rev=796078&view=rev
Log:
Fixing classes to not need UnhandledException and IllegalArgumentException

Modified:
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java
    commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
    commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java?rev=796078&r1=796077&r2=796078&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java
Mon Jul 20 23:55:30 2009
@@ -21,8 +21,6 @@
 import java.io.StringWriter;
 import java.util.Locale;
 
-import org.apache.commons.lang.UnhandledException;
-
 /**
  * An API for translating text. 
  * Its core use is to escape and unescape text. Because escaping and unescaping 
@@ -60,7 +58,7 @@
             return writer.toString();
         } catch (IOException ioe) {
             // this should never ever happen while writing to a StringWriter
-            throw new UnhandledException(ioe);
+            throw new RuntimeException(ioe);
         }
     }
 

Modified: commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java?rev=796078&r1=796077&r2=796078&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
(original)
+++ commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java
Mon Jul 20 23:55:30 2009
@@ -19,8 +19,6 @@
 import java.io.IOException;
 import java.io.Writer;
 
-import org.apache.commons.lang.UnhandledException;
-
 /**
  * Translates escaped unicode values of the form \\u+\d\d\d\d back to 
  * unicode.
@@ -49,7 +47,7 @@
                         int value = Integer.parseInt(unicode.toString(), 16);
                         out.write((char) value);
                     } catch (NumberFormatException nfe) {
-                        throw new UnhandledException("Unable to parse unicode value: " +
unicode, nfe);
+                        throw new RuntimeException("Unable to parse unicode value: " + unicode,
nfe);
                     }
                     return i + 4;
                 } else {

Modified: commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java?rev=796078&r1=796077&r2=796078&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java (original)
+++ commons/proper/lang/trunk/src/test/org/apache/commons/lang/ClassUtilsTest.java Mon Jul
20 23:55:30 2009
@@ -562,7 +562,7 @@
     }
 
     public void testGetClassInvalidArguments() throws Exception {
-        assertGetClassThrowsIllegalArgument( null );
+        assertGetClassThrowsNullPointerException( null );
         assertGetClassThrowsClassNotFound( "[][][]" );
         assertGetClassThrowsClassNotFound( "[[]" );
         assertGetClassThrowsClassNotFound( "[" );
@@ -651,8 +651,8 @@
         }
     }
 
-    private void assertGetClassThrowsIllegalArgument( String className ) throws Exception
{
-        assertGetClassThrowsException( className, IllegalArgumentException.class );
+    private void assertGetClassThrowsNullPointerException( String className ) throws Exception
{
+        assertGetClassThrowsException( className, NullPointerException.class );
     }
 
     private void assertGetClassThrowsClassNotFound( String className ) throws Exception {



Mime
View raw message