-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed support for keys that are all digits but longer than an int.
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: #604 #541
- Loading branch information
1 parent
e1c2640
commit fee9a3e
Showing
4 changed files
with
50 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// this checks sorting map keys, where keys that look like numbers are treated differently | ||
// specifically tests very long numbers which fit neither in an Integer nor in a Long | ||
|
||
"10" = "42" | ||
sth = 42 | ||
"1" = "42" | ||
"12" = "42" | ||
"123" = "42" | ||
"1234" = "42" | ||
"12345" = "42" | ||
"123456" = "42" | ||
"1234567" = "42" | ||
"12345678" = "42" | ||
"123456789" = "42" | ||
"1234567890" = "42" | ||
"12345678901" = "42" | ||
"123456789012" = "42" | ||
"1234567890123" = "42" | ||
"12345678901234" = "42" | ||
"123456789012345" = "42" | ||
"1234567890123456" = "42" | ||
"12345678901234567" = "42" | ||
"123456789012345678" = "42" | ||
"1234567890123456789" = "42" | ||
"12345678901234567891" = "42" | ||
"123456789012345678912" = "42" | ||
"1234567890123456789123" = "42" | ||
"12345678901234567891234" = "42" | ||
"123456789012345678912345" = "42" | ||
"1234567890123456789123456" = "42" | ||
"12345678901234567891234567" = "42" | ||
"123456789012345678912345678" = "42" | ||
"1234567890123456789123456789" = "42" | ||
"12345678901234567891234567890" = "42" | ||
"123456789012345678912345678901" = "42" | ||
"1234567890123456789123456789012" = "42" | ||
"12345678901234567891234567890123" = "42" | ||
"123456789012345678912345678901234" = "42" | ||
"1234567890123456789123456789012345" = "42" | ||
"12345678901234567891234567890123456" = "42" | ||
"123456789012345678912345678901234567" = "42" | ||
"1234567890123456789123456789012345678" = "42" | ||
"12345678901234567891234567890123456789" = "42" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters