Feature Request - detect key of wrong type passed to Map.get() or Map.remove()
Open
- Dominant language
- Java
- Stars
- 7.2k
- Forks
- 820
- Avg merge
- 5h 9m
- Merged PRs (30d)
- 50
Description
Since the signature of these methods, by design, does not constrict you to use the generic type of the key, and is just `Object`, it is easy to accidentally pass the wrong variable.
This is especially true for remove(), which in the case of cache clean-up code, might not have full test coverage, or missing/difficult to assert behaviour. This has been seen to lead to leaked memory.
Contributor guide
Assessment
This issue has not been assessed yet.