Unchecked call to compareTo
- by Dave Jarvis
Background
Create a Map that can be sorted by value.
Problem
The code executes as expected, but does not compile cleanly:
http://pastebin.com/bWhbHQmT
The syntax for passing Comparable as a generic parameter along to the Map.Entry<K, V> (where V must be Comparable?) -- so that the (Comparable) typecast shown in the warning can be dropped…