Details
-
Type:
Enhancement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: Backlog
-
Fix Version/s: Backlog
-
Component/s: None
-
Labels:None
-
Patch:Code and Test
-
Approval:Ok
Description
Current behavior:
- If you call keys or vals on something that is not a Map, you do not get a ClassCastException until the KeySeq or ValSeq is consumed
- Calling keys or vals on an empty collection of any type, even non-Map types, returns nil
The attached patch:
- checks the type of the argument to keys and vals and throws IllegalArgumentException if it is neither java.util.Map nor null
- changes tests for keys and vals to check that those functions throw IllegalArgumentException on empty collections that are not maps
Please don't test for specific exception types - thanks