Moving to an IllegalArgumentException: LANG-710
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1143643 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
458cf9df78
commit
d70baf1370
|
@ -46,7 +46,7 @@ public class NumericEntityUnescaper extends CharSequenceTranslator {
|
|||
*
|
||||
* 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 extends CharSequenceTranslator {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -66,8 +66,8 @@ public class NumericEntityUnescaperTest extends TestCase {
|
|||
|
||||
try {
|
||||
result = neu.translate(input);
|
||||
fail("RuntimeException expected");
|
||||
} catch(RuntimeException re) {
|
||||
fail("IllegalArgumentException expected");
|
||||
} catch(IllegalArgumentException iae) {
|
||||
// expected
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue