diff --git a/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java b/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java index a38fe0f23..ec2cf389a 100644 --- a/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java +++ b/src/java/org/apache/commons/lang/text/translate/CharSequenceTranslator.java @@ -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 @@ public final String translate(CharSequence input) { return writer.toString(); } catch (IOException ioe) { // this should never ever happen while writing to a StringWriter - throw new UnhandledException(ioe); + throw new RuntimeException(ioe); } } diff --git a/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java b/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java index 0554e4bd7..638e75ecf 100644 --- a/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java +++ b/src/java/org/apache/commons/lang/text/translate/UnicodeUnescaper.java @@ -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 @@ public int translate(CharSequence input, int index, Writer out) throws IOExcepti 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 { diff --git a/src/test/org/apache/commons/lang/ClassUtilsTest.java b/src/test/org/apache/commons/lang/ClassUtilsTest.java index 48cf3ae74..48986d6f6 100644 --- a/src/test/org/apache/commons/lang/ClassUtilsTest.java +++ b/src/test/org/apache/commons/lang/ClassUtilsTest.java @@ -562,7 +562,7 @@ public void testGetClassClassNotFound() throws Exception { } public void testGetClassInvalidArguments() throws Exception { - assertGetClassThrowsIllegalArgument( null ); + assertGetClassThrowsNullPointerException( null ); assertGetClassThrowsClassNotFound( "[][][]" ); assertGetClassThrowsClassNotFound( "[[]" ); assertGetClassThrowsClassNotFound( "[" ); @@ -651,8 +651,8 @@ private void assertGetClassThrowsException( String className, Class exceptionTyp } } - 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 {