Copilot commented on code in PR #1816:
URL: https://github.com/apache/commons-lang/pull/1816#discussion_r4261009063


##########
src/main/java/org/apache/commons/lang3/CharUtils.java:
##########
@@ -460,8 +460,8 @@ public static int toIntValue(final char ch) {
     }
 
     /**
-     * Converts the character to the Integer it represents, throwing an
-     * exception if the character is not numeric.
+     * Converts the character to the Integer it represents, returning the
+     * default value if the character is not ASCII numeric.

Review Comment:
   “ASCII numeric” is a bit ambiguous terminology for readers (it can be read 
as either ‘ASCII digit’ or ‘any numeric char in ASCII’, and ‘numeric’ can imply 
Unicode digits). Since the implementation for these methods typically accepts 
only '0'..'9', it would be clearer and more precise to say “not an ASCII digit 
('0'–'9')” (or equivalent). This reduces the chance of misunderstanding about 
Unicode digit handling.



##########
src/main/java/org/apache/commons/lang3/CharUtils.java:
##########
@@ -504,8 +504,8 @@ public static int toIntValue(final Character ch) {
     }
 
     /**
-     * Converts the character to the Integer it represents, throwing an
-     * exception if the character is not numeric.
+     * Converts the character to the Integer it represents, returning the
+     * default value if the character is not ASCII numeric.

Review Comment:
   Same wording concern as the `char` overload: consider using “ASCII digit 
('0'–'9')” instead of “ASCII numeric” to precisely document the accepted input 
range and avoid implying broader numeric/Unicode support.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to