commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject svn commit: r1143643 - in /commons/proper/lang/trunk/src: main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java
Date Thu, 07 Jul 2011 03:47:17 GMT
Author: bayard
Date: Thu Jul  7 03:47:17 2011
New Revision: 1143643

URL: http://svn.apache.org/viewvc?rev=1143643&view=rev
Log:
Moving to an IllegalArgumentException: LANG-710

Modified:
    commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
    commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java

Modified: commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java?rev=1143643&r1=1143642&r2=1143643&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
(original)
+++ commons/proper/lang/trunk/src/main/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaper.java
Thu Jul  7 03:47:17 2011
@@ -46,7 +46,7 @@ public class NumericEntityUnescaper exte
      *
      * For example, to support numeric entities without a ';':
      *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.semiColonOptional)
-     * and to throw a RuntimeException when they're missing:
+     * and to throw an IllegalArgumentException when they're missing:
      *    new NumericEntityUnescaper(NumericEntityUnescaper.OPTION.errorIfNoSemiColon)
      *
      * Note that the default behaviour is to ignore them. 
@@ -109,7 +109,7 @@ public class NumericEntityUnescaper exte
                     return 0;
                 } else
                 if(isSet(OPTION.errorIfNoSemiColon)) {
-                    throw new RuntimeException("Semi-colon required at end of numeric entity");
+                    throw new IllegalArgumentException("Semi-colon required at end of numeric
entity");
                 }
             }
 

Modified: commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java
URL: http://svn.apache.org/viewvc/commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java?rev=1143643&r1=1143642&r2=1143643&view=diff
==============================================================================
--- commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java
(original)
+++ commons/proper/lang/trunk/src/test/java/org/apache/commons/lang3/text/translate/NumericEntityUnescaperTest.java
Thu Jul  7 03:47:17 2011
@@ -66,8 +66,8 @@ public class NumericEntityUnescaperTest 
 
         try {
             result = neu.translate(input);
-            fail("RuntimeException expected");
-        } catch(RuntimeException re) {
+            fail("IllegalArgumentException expected");
+        } catch(IllegalArgumentException iae) {
             // expected
         }
     }



Mime
View raw message