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

Metadata may contain java.util.Collections$EmptyMap types #98

Open
dgoeke opened this issue Apr 12, 2018 · 1 comment
Open

Metadata may contain java.util.Collections$EmptyMap types #98

dgoeke opened this issue Apr 12, 2018 · 1 comment

Comments

@dgoeke
Copy link

dgoeke commented Apr 12, 2018

While writing some message retry logic, we discovered that it's not safe to perform operations like (update-in metadata [:headers :field-here] f) because when no headers are present, the field is a java.util.Collections$EmptyMap. This type isn't associative so clojure functions like assoc/update throw exceptions when dealing with it.

@michaelklishin
Copy link
Owner

I PR that coerces such instances to empty Clojure maps would be appreciated.

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

No branches or pull requests

2 participants