mkodekar / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Maps.unmodifiableNavigableMap not covariant in V #1870

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 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.

Original issue reported on code.google.com by thecoop1...@googlemail.com on 23 Oct 2014 at 8:42

GoogleCodeExporter commented 9 years ago
I believe you are correct. And this will probably be sufficiently safe to 
change. Thanks!

Original comment by kevinb@google.com on 23 Oct 2014 at 2:20

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:08

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:07