-
Notifications
You must be signed in to change notification settings - Fork 968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
long int as key makes NumberFormatException #541
Comments
Thanks for debugging this, that makes sense. I'm a little tempted to try to figure out how to avoid creating those BigDecimal objects in the common case (common case is a few integers from 0-5 or so), but it would definitely make the code more complex to do that, so I dunno if it really matters. Would also be good to add a test for this scenario. |
RenderComparator inner class could be implemented without need for Integer.parseInt or BigDecimal, like this:
|
I think this may be fixed on master - there was a PR that fixed it, anyway, even if not merged |
it's fixed in this PR which isn't merged yet I guess #557 |
Yes, I see that now. If you still believe that using BigInteger might be an overkill here code above could be directly used in DefaultComparator. |
Previously such config keys would still be parsed with `Integer#parseInt` for the sake of sorting, resulting in a `NumberFormatException`. Now the keys consisting of digits only are parsed to a `BigInteger` and compared as such. This addresses the following issues: lightbend#604 lightbend#541
Previously such config keys would still be parsed with `Integer#parseInt` for the sake of sorting, resulting in a `NumberFormatException`. Now the keys consisting of digits only are parsed to a `BigInteger` and compared as such. This addresses the following issues: lightbend#604 lightbend#541
This is still not fixed? |
config/config/src/main/java/com/typesafe/config/impl/SimpleConfigObject.java
Line 452 in eeb9582
when key is all digits, and bigger than Integer.MAX
this line can throw NumberFormatException
maybe use BigDecimal instead of Integer when dealing with all-digits long string key.
The text was updated successfully, but these errors were encountered: