robtimus commented on a change in pull request #450: Add and use 
IllegalArgumentExceptions
URL: https://github.com/apache/commons-lang/pull/450#discussion_r320932770
 
 

 ##########
 File path: src/main/java/org/apache/commons/lang3/CharUtils.java
 ##########
 @@ -219,7 +221,7 @@ public static char toChar(final String str, final char 
defaultValue) {
      */
     public static int toIntValue(final char ch) {
         if (!isAsciiNumeric(ch)) {
-            throw new IllegalArgumentException("The character " + ch + " is 
not in the range '0' - '9'");
+            throw IllegalArgumentExceptions.format("The character %s is not in 
the range '0' - '9'", ch);
 
 Review comment:
   Shouldn't %s be %c instead? The same applies to some other exceptions using 
char.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to