migrator / guava-libraries

Guava: Google Core Libraries for Java 1.6+
0 stars 0 forks source link

Maps.unmodifiableNavigableMap not covariant in V #35

Open migrator opened 10 years ago

migrator commented 10 years ago

Maps.unmodifiableNavigableMap is declared as follows:

<K, V> NavigableMap<K, V> unmodifiableNavigableMap(NavigableMap<K, V> map);

this could be changed to

<K, V> NavigableMap<K, V> unmodifiableNavigableMap(NavigableMap<K, ? extends V> map);

as there are no methods in NavigableMap that take a V as a method parameter. This would also be consistent with the declarations of Collections.unmodifiableSortedMap and ImmutableSortedMap.copyOfSorted.

relevance: 2

migrator commented 10 years ago

summary: Not Defined

I believe you are correct. And this will probably be sufficiently safe to change. Thanks!

status Not Defined creator: kevinb@google.com created at: Oct 23 (5 days ago)