garydgregory commented on code in PR #1623:
URL: https://github.com/apache/commons-lang/pull/1623#discussion_r3036730161
##########
src/main/java/org/apache/commons/lang3/math/NumberUtils.java:
##########
@@ -508,7 +508,11 @@ public static Number createNumber(final String str) {
} catch (final NumberFormatException ignored) {
// ignore the bad number
}
- return createBigDecimal(str);
+ try {
+ return createBigDecimal(str);
+ } catch (final NumberFormatException ignored) {
+ throw new NumberFormatException(str + " is not a valid number.");
Review Comment:
This doesn't seem necessary. Also the original cause is lost, making the
input harder to debug.
--
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]