Skip to content
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

Better diagnostics for map iteration while mutating #10

Merged
merged 1 commit into from
Dec 16, 2023

Conversation

ericeil
Copy link
Collaborator

@ericeil ericeil commented Dec 15, 2023

If one obtains a MutableMap.Entry from a mutable map / builder, and then removes the underlying value from the map, we currently return null from the entry's value property, rather than throwing. Either behavior is allowed by the MutableMap.Entry spec, which specifies IllegalStateException or undefined behavior in this case - but it's much easier to debug this if an exception is thrown.

If one obtains a `MutableMap.Entry` from a mutable map / builder, and then removes the underlying value from the map, we currently return `null` from the entry's `value` property, rather than throwing.  Either behavior is allowed by the `MutableMap.Entry` spec (which specifies `IllegalStateException` *or* undefined behavior in this case), but it's much easier to debug this if an exception is thrown.
@ericeil ericeil requested a review from jtoman December 15, 2023 22:58
@ericeil ericeil merged commit 9ccf2b2 into Certora:main Dec 16, 2023
1 check passed
@ericeil ericeil deleted the mapEntry branch December 16, 2023 00:10
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