Skip to content

Fix NumberFormatException with very large numbers in ArrayMap#577

Open
veeti wants to merge 1 commit into
diffplug:mainfrom
veeti:arraymap-fixes
Open

Fix NumberFormatException with very large numbers in ArrayMap#577
veeti wants to merge 1 commit into
diffplug:mainfrom
veeti:arraymap-fixes

Conversation

@veeti
Copy link
Copy Markdown

@veeti veeti commented May 23, 2026

Test case names containing long numbers could result in a NumberFormatException being thrown. Support arbitrarily large numbers by comparing strings.

Test case names containing long numbers could result in a
NumberFormatException being thrown. Support arbitrarily large numbers by
comparing strings.
@nedtwigg
Copy link
Copy Markdown
Member

IIUC, this helps once there are more than 2,147,483,647 snapshots.

If each snapshot has size of only 1 byte, this would be ~2Gb of snapshot data (not counting indirection). I would guess ~10GB in RAM, even if the data was only a single byte being snapshotted.

Do you have a usecase where you need this? How did you choose to work on this change?

@veeti
Copy link
Copy Markdown
Author

veeti commented May 23, 2026

I am hitting this from my Kotest suite. This reproducer should demonstrate:

class ArrayMapNumberFormatTest : DescribeSpec({
    it("a123") {}
    it("a${Long.MAX_VALUE}") {}
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants