KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I recently stumbled across the Javadoc for the Collection.checkedMap family of functions for creating dynamically typesafe views of the standard Collections types. Considering that they add another layer of safety on top of the collections that diagnoses a relatively common programmer error, I would have figured that they would be more popular. For some reason, though, in all of the large Java projects I've worked on, I've not seen them used once. My question is this: is there a particular reason that Java programmers don't use these checked wrappers more frequently? Or is it just lack of benefit/lack of knowledge of their existence? EDIT : To clarify my question, the generic versions of the collections still contain type-unsafe functions. Map 's containsKey , containsValue , remove , and get all operate on Object , for example. My main question is, given this type-unsafety, why more people don't use the checked implementations to diagnose runtime type violations.
Tags (comma-separated)
Save Edits
Cancel