Skip to content

Fix HashMapIdObject.toString() on an empty map - #319

Merged
fh-ms merged 1 commit into
mainfrom
fix/hashmapidobject-tostring
Oct 5, 2026
Merged

fh-ms merged 1 commit into
mainfrom
fix/hashmapidobject-tostring

Conversation

@fh-ms

@fh-ms fh-ms commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

toString() always deleted the trailing ", " separator and replaced the last char with '}'. On an empty map the buffer only held "{", so deleteLast() emptied it and setLast() threw StringIndexOutOfBoundsException. An empty map now returns "{}".

toString() always deleted the trailing ", " separator and replaced the last char with '}'. On an empty map the buffer only held "{", so deleteLast() emptied it and setLast() threw StringIndexOutOfBoundsException. An empty map now returns "{}".
@fh-ms
fh-ms requested a review from zdenek-jonas October 5, 2026 11:38
@fh-ms
fh-ms merged commit 4b2ad91 into main Oct 5, 2026
19 checks passed
@fh-ms
fh-ms deleted the fix/hashmapidobject-tostring branch October 5, 2026 11:52
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