commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1533984 - in /commons/proper/collections/trunk/src: changes/ main/java/org/apache/commons/collections4/ main/java/org/apache/commons/collections4/bag/ main/java/org/apache/commons/collections4/bidimap/ main/java/org/apache/commons/collecti...
Date Sun, 20 Oct 2013 21:12:52 GMT
Author: tn
Date: Sun Oct 20 21:12:51 2013
New Revision: 1533984

URL: http://svn.apache.org/r1533984
Log:
[COLLECTIONS-485] Added wildcards to copy-constructors and unmodifiable decorators / iterators, thanks to Hollis Waite.

Modified:
    commons/proper/collections/trunk/src/changes/changes.xml
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/BagUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/EnumerationUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/ListUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/QueueUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/SetUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/TrieUtils.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/TreeList.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/HashedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LRUMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LinkedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java

Modified: commons/proper/collections/trunk/src/changes/changes.xml
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/changes/changes.xml?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/changes/changes.xml (original)
+++ commons/proper/collections/trunk/src/changes/changes.xml Sun Oct 20 21:12:51 2013
@@ -22,6 +22,10 @@
   <body>
 
   <release version="4.0" date="TBA" description="Next release">
+    <action issue="COLLECTIONS-485" dev="tn" type="fix" due-to="Hollis Waite">
+     Accept wildcard input where possible, e.g. in copy-constructors, Unmodifiable* decorators
+     and iterators.
+    </action>
     <action issue="COLLECTIONS-481" dev="tn" type="fix" due-to="Hollis Waite">
      No collision detection/resolution was performed when calling "CompositeSet#addComposited(...)"
      with more than one Set as argument. Additionally use varargs parameters instead of arrays

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/BagUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/BagUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/BagUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/BagUtils.java Sun Oct 20 21:12:51 2013
@@ -92,7 +92,7 @@ public class BagUtils {
      * @return an unmodifiable view of that bag
      * @throws IllegalArgumentException if the Bag is null
      */
-    public static <E> Bag<E> unmodifiableBag(final Bag<E> bag) {
+    public static <E> Bag<E> unmodifiableBag(final Bag<? extends E> bag) {
         return UnmodifiableBag.unmodifiableBag(bag);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/CollectionUtils.java Sun Oct 20 21:12:51 2013
@@ -1701,7 +1701,7 @@ public class CollectionUtils {
      * @return an unmodifiable collection backed by the given collection
      * @throws IllegalArgumentException  if the collection is null
      */
-    public static <C> Collection<C> unmodifiableCollection(final Collection<C> collection) {
+    public static <C> Collection<C> unmodifiableCollection(final Collection<? extends C> collection) {
         return UnmodifiableCollection.unmodifiableCollection(collection);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/EnumerationUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/EnumerationUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/EnumerationUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/EnumerationUtils.java Sun Oct 20 21:12:51 2013
@@ -47,7 +47,7 @@ public class EnumerationUtils {
      * @return a list containing all elements of the given enumeration
      * @throws NullPointerException if the enumeration parameter is <code>null</code>.
      */
-    public static <E> List<E> toList(final Enumeration<E> enumeration) {
+    public static <E> List<E> toList(final Enumeration<? extends E> enumeration) {
         return IteratorUtils.toList(new EnumerationIterator<E>(enumeration));
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/ListUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/ListUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/ListUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/ListUtils.java Sun Oct 20 21:12:51 2013
@@ -398,7 +398,7 @@ public class ListUtils {
      * @return an unmodifiable list backed by the given list
      * @throws IllegalArgumentException  if the list is null
      */
-    public static <E> List<E> unmodifiableList(final List<E> list) {
+    public static <E> List<E> unmodifiableList(final List<? extends E> list) {
         return UnmodifiableList.unmodifiableList(list);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/MapUtils.java Sun Oct 20 21:12:51 2013
@@ -1258,7 +1258,7 @@ public class MapUtils {
      * @return an unmodifiable map backed by the given map
      * @throws IllegalArgumentException  if the map is null
      */
-    public static <K, V> Map<K, V> unmodifiableMap(final Map<K, V> map) {
+    public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) {
         return UnmodifiableMap.unmodifiableMap(map);
     }
 
@@ -1517,7 +1517,7 @@ public class MapUtils {
      * @return an unmodifiable map backed by the given map
      * @throws IllegalArgumentException  if the map is null
      */
-    public static <K, V> SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, V> map) {
+    public static <K, V> SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, ? extends V> map) {
         return UnmodifiableSortedMap.unmodifiableSortedMap(map);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/QueueUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/QueueUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/QueueUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/QueueUtils.java Sun Oct 20 21:12:51 2013
@@ -51,7 +51,7 @@ public class QueueUtils {
      * @return an unmodifiable queue backed by that queue
      * @throws IllegalArgumentException  if the Queue is null
      */
-    public static <E> Queue<E> unmodifiableQueue(final Queue<E> queue) {
+    public static <E> Queue<E> unmodifiableQueue(final Queue<? extends E> queue) {
         return UnmodifiableQueue.unmodifiableQueue(queue);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/SetUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/SetUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/SetUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/SetUtils.java Sun Oct 20 21:12:51 2013
@@ -188,7 +188,7 @@ public class SetUtils {
      * @return an unmodifiable set backed by the given set
      * @throws IllegalArgumentException  if the set is null
      */
-    public static <E> Set<E> unmodifiableSet(final Set<E> set) {
+    public static <E> Set<E> unmodifiableSet(final Set<? extends E> set) {
         return UnmodifiableSet.unmodifiableSet(set);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/TrieUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/TrieUtils.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/TrieUtils.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/TrieUtils.java Sun Oct 20 21:12:51 2013
@@ -41,7 +41,7 @@ public class TrieUtils {
      *
      * @see java.util.Collections#unmodifiableMap(java.util.Map)
      */
-    public static <K, V> Trie<K, V> unmodifiableTrie(final Trie<K, V> trie) {
+    public static <K, V> Trie<K, V> unmodifiableTrie(final Trie<K, ? extends V> trie) {
         return UnmodifiableTrie.unmodifiableTrie(trie);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bag/UnmodifiableBag.java Sun Oct 20 21:12:51 2013
@@ -56,9 +56,11 @@ public final class UnmodifiableBag<E>
      * @throws IllegalArgumentException if bag is null
      * @since 4.0
      */
-    public static <E> Bag<E> unmodifiableBag(final Bag<E> bag) {
+    public static <E> Bag<E> unmodifiableBag(final Bag<? extends E> bag) {
         if (bag instanceof Unmodifiable) {
-            return bag;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Bag<E> tmpBag = (Bag<E>) bag;
+            return tmpBag;
         }
         return new UnmodifiableBag<E>(bag);
     }
@@ -70,8 +72,9 @@ public final class UnmodifiableBag<E>
      * @param bag  the bag to decorate, must not be null
      * @throws IllegalArgumentException if bag is null
      */
-    private UnmodifiableBag(final Bag<E> bag) {
-        super(bag);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableBag(final Bag<? extends E> bag) {
+        super((Bag<E>) bag);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualHashBidiMap.java Sun Oct 20 21:12:51 2013
@@ -57,7 +57,7 @@ public class DualHashBidiMap<K, V> exten
      *
      * @param map  the map whose mappings are to be placed in this map
      */
-    public DualHashBidiMap(final Map<K, V> map) {
+    public DualHashBidiMap(final Map<? extends K, ? extends V> map) {
         super(new HashMap<K, V>(), new HashMap<V, K>());
         putAll(map);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualLinkedHashBidiMap.java Sun Oct 20 21:12:51 2013
@@ -16,8 +16,6 @@
  */
 package org.apache.commons.collections4.bidimap;
 
-import org.apache.commons.collections4.BidiMap;
-
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
@@ -25,6 +23,8 @@ import java.io.Serializable;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.apache.commons.collections4.BidiMap;
+
 /**
  * Implementation of <code>BidiMap</code> that uses two <code>LinkedHashMap</code> instances.
  * <p>
@@ -52,7 +52,7 @@ public class DualLinkedHashBidiMap<K, V>
      *
      * @param map the map whose mappings are to be placed in this map
      */
-    public DualLinkedHashBidiMap(final Map<K, V> map) {
+    public DualLinkedHashBidiMap(final Map<? extends K, ? extends V> map) {
         super(new LinkedHashMap<K, V>(), new LinkedHashMap<V, K>());
         putAll(map);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/DualTreeBidiMap.java Sun Oct 20 21:12:51 2013
@@ -79,7 +79,7 @@ public class DualTreeBidiMap<K, V> exten
      *
      * @param map  the map whose mappings are to be placed in this map
      */
-    public DualTreeBidiMap(final Map<K, V> map) {
+    public DualTreeBidiMap(final Map<? extends K, ? extends V> map) {
         super(new TreeMap<K, V>(), new TreeMap<V, K>());
         putAll(map);
         this.comparator = null;

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/TreeBidiMap.java Sun Oct 20 21:12:51 2013
@@ -126,7 +126,7 @@ public class TreeBidiMap<K extends Compa
      *  not Comparable or are not mutually comparable
      * @throws NullPointerException if any key or value in the map is null
      */
-    public TreeBidiMap(final Map<K, V> map) {
+    public TreeBidiMap(final Map<? extends K, ? extends V> map) {
         this();
         putAll(map);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableBidiMap.java Sun Oct 20 21:12:51 2013
@@ -52,9 +52,11 @@ public final class UnmodifiableBidiMap<K
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> BidiMap<K, V> unmodifiableBidiMap(final BidiMap<K, V> map) {
+    public static <K, V> BidiMap<K, V> unmodifiableBidiMap(final BidiMap<? extends K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final BidiMap<K, V> tmpMap = (BidiMap<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableBidiMap<K, V>(map);
     }
@@ -66,8 +68,9 @@ public final class UnmodifiableBidiMap<K
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableBidiMap(final BidiMap<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableBidiMap(final BidiMap<? extends K, ? extends V> map) {
+        super((BidiMap<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableOrderedBidiMap.java Sun Oct 20 21:12:51 2013
@@ -52,9 +52,12 @@ public final class UnmodifiableOrderedBi
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> OrderedBidiMap<K, V> unmodifiableOrderedBidiMap(final OrderedBidiMap<K, V> map) {
+    public static <K, V> OrderedBidiMap<K, V> unmodifiableOrderedBidiMap(
+            final OrderedBidiMap<? extends K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final OrderedBidiMap<K, V> tmpMap = (OrderedBidiMap<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableOrderedBidiMap<K, V>(map);
     }
@@ -66,8 +69,9 @@ public final class UnmodifiableOrderedBi
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableOrderedBidiMap(final OrderedBidiMap<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableOrderedBidiMap(final OrderedBidiMap<? extends K, ? extends V> map) {
+        super((OrderedBidiMap<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/bidimap/UnmodifiableSortedBidiMap.java Sun Oct 20 21:12:51 2013
@@ -54,9 +54,11 @@ public final class UnmodifiableSortedBid
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> SortedBidiMap<K, V> unmodifiableSortedBidiMap(final SortedBidiMap<K, V> map) {
+    public static <K, V> SortedBidiMap<K, V> unmodifiableSortedBidiMap(final SortedBidiMap<K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final SortedBidiMap<K, V> tmpMap = (SortedBidiMap<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableSortedBidiMap<K, V>(map);
     }
@@ -68,8 +70,9 @@ public final class UnmodifiableSortedBid
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableSortedBidiMap(final SortedBidiMap<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableSortedBidiMap(final SortedBidiMap<K, ? extends V> map) {
+        super((SortedBidiMap<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableBoundedCollection.java Sun Oct 20 21:12:51 2013
@@ -54,7 +54,7 @@ public final class UnmodifiableBoundedCo
      * @throws IllegalArgumentException if {@code coll} is {@code null}
      * @since 4.0
      */
-    public static <E> BoundedCollection<E> unmodifiableBoundedCollection(final BoundedCollection<E> coll) {
+    public static <E> BoundedCollection<E> unmodifiableBoundedCollection(final BoundedCollection<? extends E> coll) {
         return new UnmodifiableBoundedCollection<E>(coll);
     }
 
@@ -100,8 +100,9 @@ public final class UnmodifiableBoundedCo
      * @param coll  the collection to decorate, must not be null
      * @throws IllegalArgumentException if coll is null
      */
-    private UnmodifiableBoundedCollection(final BoundedCollection<E> coll) {
-        super(coll);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableBoundedCollection(final BoundedCollection<? extends E> coll) {
+        super((BoundedCollection<E>) coll);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/collection/UnmodifiableCollection.java Sun Oct 20 21:12:51 2013
@@ -51,9 +51,11 @@ public final class UnmodifiableCollectio
      * @throws IllegalArgumentException if collection is null
      * @since 4.0
      */
-    public static <T> Collection<T> unmodifiableCollection(final Collection<T> coll) {
+    public static <T> Collection<T> unmodifiableCollection(final Collection<? extends T> coll) {
         if (coll instanceof Unmodifiable) {
-            return coll;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Collection<T> tmpColl = (Collection<T>) coll;
+            return tmpColl;
         }
         return new UnmodifiableCollection<T>(coll);
     }
@@ -65,8 +67,9 @@ public final class UnmodifiableCollectio
      * @param coll  the collection to decorate, must not be null
      * @throws IllegalArgumentException if collection is null
      */
-    private UnmodifiableCollection(final Collection<E> coll) {
-        super(coll);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableCollection(final Collection<? extends E> coll) {
+        super((Collection<E>) coll);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ComparatorChain.java Sun Oct 20 21:12:51 2013
@@ -273,7 +273,7 @@ public class ComparatorChain<E> implemen
         final Iterator<Comparator<E>> comparators = comparatorChain.iterator();
         for (int comparatorIndex = 0; comparators.hasNext(); ++comparatorIndex) {
 
-            final Comparator<E> comparator = comparators.next();
+            final Comparator<? super E> comparator = comparators.next();
             int retval = comparator.compare(o1,o2);
             if (retval != 0) {
                 // invert the order if it is a reverse sort

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/NullComparator.java Sun Oct 20 21:12:51 2013
@@ -36,7 +36,7 @@ public class NullComparator<E> implement
     /**
      *  The comparator to use when comparing two non-<code>null</code> objects.
      **/
-    private final Comparator<E> nonNullComparator;
+    private final Comparator<? super E> nonNullComparator;
 
     /**
      *  Specifies whether a <code>null</code> are compared as higher than
@@ -69,7 +69,7 @@ public class NullComparator<E> implement
      *  @exception NullPointerException if <code>nonNullComparator</code> is
      *  <code>null</code>
      **/
-    public NullComparator(final Comparator<E> nonNullComparator) {
+    public NullComparator(final Comparator<? super E> nonNullComparator) {
         this(nonNullComparator, true);
     }
 
@@ -109,7 +109,7 @@ public class NullComparator<E> implement
      *  @exception NullPointerException if <code>nonNullComparator</code> is
      *  <code>null</code>
      **/
-    public NullComparator(final Comparator<E> nonNullComparator, final boolean nullsAreHigh) {
+    public NullComparator(final Comparator<? super E> nonNullComparator, final boolean nullsAreHigh) {
         this.nonNullComparator = nonNullComparator;
         this.nullsAreHigh = nullsAreHigh;
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/ReverseComparator.java Sun Oct 20 21:12:51 2013
@@ -60,7 +60,7 @@ public class ReverseComparator<E> implem
      * @param comparator Comparator to reverse
      */
     @SuppressWarnings("unchecked")
-    public ReverseComparator(final Comparator<E> comparator) {
+    public ReverseComparator(final Comparator<? super E> comparator) {
         this.comparator = comparator == null ? ComparatorUtils.NATURAL_COMPARATOR : comparator;
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/PermutationIterator.java Sun Oct 20 21:12:51 2013
@@ -73,7 +73,7 @@ public class PermutationIterator<E> impl
      * @param coll  the collection to generate permutations for
      * @throws NullPointerException if coll is null
      */
-    public PermutationIterator(final Collection<E> coll) {
+    public PermutationIterator(final Collection<? extends E> coll) {
         if (coll == null) {
             throw new NullPointerException("The collection must not be null");
         }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableIterator.java Sun Oct 20 21:12:51 2013
@@ -31,7 +31,7 @@ import org.apache.commons.collections4.U
 public final class UnmodifiableIterator<E> implements Iterator<E>, Unmodifiable {
 
     /** The iterator being decorated */
-    private final Iterator<E> iterator;
+    private final Iterator<? extends E> iterator;
 
     //-----------------------------------------------------------------------
     /**
@@ -44,12 +44,14 @@ public final class UnmodifiableIterator<
      * @return a new unmodifiable iterator
      * @throws IllegalArgumentException if the iterator is null
      */
-    public static <E> Iterator<E> unmodifiableIterator(final Iterator<E> iterator) {
+    public static <E> Iterator<E> unmodifiableIterator(final Iterator<? extends E> iterator) {
         if (iterator == null) {
             throw new IllegalArgumentException("Iterator must not be null");
         }
         if (iterator instanceof Unmodifiable) {
-            return iterator;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Iterator<E> tmpIterator = (Iterator<E>) iterator;
+            return tmpIterator;
         }
         return new UnmodifiableIterator<E>(iterator);
     }
@@ -60,7 +62,7 @@ public final class UnmodifiableIterator<
      *
      * @param iterator  the iterator to decorate
      */
-    private UnmodifiableIterator(final Iterator<E> iterator) {
+    private UnmodifiableIterator(final Iterator<? extends E> iterator) {
         super();
         this.iterator = iterator;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableListIterator.java Sun Oct 20 21:12:51 2013
@@ -31,7 +31,7 @@ import org.apache.commons.collections4.U
 public final class UnmodifiableListIterator<E> implements ListIterator<E>, Unmodifiable {
 
     /** The iterator being decorated */
-    private final ListIterator<E> iterator;
+    private final ListIterator<? extends E> iterator;
 
     //-----------------------------------------------------------------------
     /**
@@ -42,12 +42,14 @@ public final class UnmodifiableListItera
      * @return a new unmodifiable list iterator
      * @throws IllegalArgumentException if the iterator is null
      */
-    public static <E> ListIterator<E> umodifiableListIterator(final ListIterator<E> iterator) {
+    public static <E> ListIterator<E> umodifiableListIterator(final ListIterator<? extends E> iterator) {
         if (iterator == null) {
             throw new IllegalArgumentException("ListIterator must not be null");
         }
         if (iterator instanceof Unmodifiable) {
-            return iterator;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final ListIterator<E> tmpIterator = (ListIterator<E>) iterator;
+            return tmpIterator;
         }
         return new UnmodifiableListIterator<E>(iterator);
     }
@@ -58,7 +60,7 @@ public final class UnmodifiableListItera
      *
      * @param iterator  the iterator to decorate
      */
-    private UnmodifiableListIterator(final ListIterator<E> iterator) {
+    private UnmodifiableListIterator(final ListIterator<? extends E> iterator) {
         super();
         this.iterator = iterator;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableMapIterator.java Sun Oct 20 21:12:51 2013
@@ -30,7 +30,7 @@ import org.apache.commons.collections4.U
 public final class UnmodifiableMapIterator<K, V> implements MapIterator<K, V>, Unmodifiable {
 
     /** The iterator being decorated */
-    private final MapIterator<K, V> iterator;
+    private final MapIterator<? extends K, ? extends V> iterator;
 
     //-----------------------------------------------------------------------
     /**
@@ -42,12 +42,15 @@ public final class UnmodifiableMapIterat
      * @return a new unmodifiable map iterator
      * @throws IllegalArgumentException if the iterator is null
      */
-    public static <K, V> MapIterator<K, V> unmodifiableMapIterator(final MapIterator<K, V> iterator) {
+    public static <K, V> MapIterator<K, V> unmodifiableMapIterator(
+            final MapIterator<? extends K, ? extends V> iterator) {
         if (iterator == null) {
             throw new IllegalArgumentException("MapIterator must not be null");
         }
         if (iterator instanceof Unmodifiable) {
-            return iterator;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final MapIterator<K, V> tmpIterator = (MapIterator<K, V>) iterator;
+            return tmpIterator;
         }
         return new UnmodifiableMapIterator<K, V>(iterator);
     }
@@ -58,7 +61,7 @@ public final class UnmodifiableMapIterat
      *
      * @param iterator  the iterator to decorate
      */
-    private UnmodifiableMapIterator(final MapIterator<K, V> iterator) {
+    private UnmodifiableMapIterator(final MapIterator<? extends K, ? extends V> iterator) {
         super();
         this.iterator = iterator;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/iterators/UnmodifiableOrderedMapIterator.java Sun Oct 20 21:12:51 2013
@@ -31,7 +31,7 @@ public final class UnmodifiableOrderedMa
         Unmodifiable {
 
     /** The iterator being decorated */
-    private final OrderedMapIterator<K, V> iterator;
+    private final OrderedMapIterator<? extends K, ? extends V> iterator;
 
     //-----------------------------------------------------------------------
     /**
@@ -44,13 +44,15 @@ public final class UnmodifiableOrderedMa
      * @throws IllegalArgumentException if the iterator is null
      */
     public static <K, V> OrderedMapIterator<K, V> unmodifiableOrderedMapIterator(
-            final OrderedMapIterator<K, V> iterator) {
+            final OrderedMapIterator<K, ? extends V> iterator) {
 
         if (iterator == null) {
             throw new IllegalArgumentException("OrderedMapIterator must not be null");
         }
         if (iterator instanceof Unmodifiable) {
-            return iterator;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final OrderedMapIterator<K, V> tmpIterator = (OrderedMapIterator<K, V>) iterator;
+            return tmpIterator;
         }
         return new UnmodifiableOrderedMapIterator<K, V>(iterator);
     }
@@ -61,7 +63,7 @@ public final class UnmodifiableOrderedMa
      *
      * @param iterator  the iterator to decorate
      */
-    private UnmodifiableOrderedMapIterator(final OrderedMapIterator<K, V> iterator) {
+    private UnmodifiableOrderedMapIterator(final OrderedMapIterator<K, ? extends V> iterator) {
         super();
         this.iterator = iterator;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultKeyValue.java Sun Oct 20 21:12:51 2013
@@ -55,7 +55,7 @@ public class DefaultKeyValue<K, V> exten
      * @param pair  the pair to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public DefaultKeyValue(final KeyValue<K, V> pair) {
+    public DefaultKeyValue(final KeyValue<? extends K, ? extends V> pair) {
         super(pair.getKey(), pair.getValue());
     }
 
@@ -65,7 +65,7 @@ public class DefaultKeyValue<K, V> exten
      * @param entry  the entry to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public DefaultKeyValue(final Map.Entry<K, V> entry) {
+    public DefaultKeyValue(final Map.Entry<? extends K, ? extends V> entry) {
         super(entry.getKey(), entry.getValue());
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/DefaultMapEntry.java Sun Oct 20 21:12:51 2013
@@ -45,7 +45,7 @@ public final class DefaultMapEntry<K, V>
      * @param pair  the pair to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public DefaultMapEntry(final KeyValue<K, V> pair) {
+    public DefaultMapEntry(final KeyValue<? extends K, ? extends V> pair) {
         super(pair.getKey(), pair.getValue());
     }
 
@@ -55,7 +55,7 @@ public final class DefaultMapEntry<K, V>
      * @param entry  the entry to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public DefaultMapEntry(final Map.Entry<K, V> entry) {
+    public DefaultMapEntry(final Map.Entry<? extends K, ? extends V> entry) {
         super(entry.getKey(), entry.getValue());
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/keyvalue/UnmodifiableMapEntry.java Sun Oct 20 21:12:51 2013
@@ -46,7 +46,7 @@ public final class UnmodifiableMapEntry<
      * @param pair  the pair to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public UnmodifiableMapEntry(final KeyValue<K, V> pair) {
+    public UnmodifiableMapEntry(final KeyValue<? extends K, ? extends V> pair) {
         super(pair.getKey(), pair.getValue());
     }
 
@@ -56,7 +56,7 @@ public final class UnmodifiableMapEntry<
      * @param entry  the entry to copy, must not be null
      * @throws NullPointerException if the entry is null
      */
-    public UnmodifiableMapEntry(final Map.Entry<K, V> entry) {
+    public UnmodifiableMapEntry(final Map.Entry<? extends K, ? extends V> entry) {
         super(entry.getKey(), entry.getValue());
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/CursorableLinkedList.java Sun Oct 20 21:12:51 2013
@@ -77,7 +77,7 @@ public class CursorableLinkedList<E> ext
      *
      * @param coll  the collection to copy
      */
-    public CursorableLinkedList(final Collection<E> coll) {
+    public CursorableLinkedList(final Collection<? extends E> coll) {
         super(coll);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/NodeCachingLinkedList.java Sun Oct 20 21:12:51 2013
@@ -79,7 +79,7 @@ public class NodeCachingLinkedList<E> ex
      *
      * @param coll  the collection to copy
      */
-    public NodeCachingLinkedList(final Collection<E> coll) {
+    public NodeCachingLinkedList(final Collection<? extends E> coll) {
         super(coll);
         this.maximumCacheSize = DEFAULT_MAXIMUM_CACHE_SIZE;
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/TreeList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/TreeList.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/TreeList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/TreeList.java Sun Oct 20 21:12:51 2013
@@ -81,7 +81,7 @@ public class TreeList<E> extends Abstrac
      * @param coll  the collection to copy
      * @throws NullPointerException if the collection is null
      */
-    public TreeList(final Collection<E> coll) {
+    public TreeList(final Collection<? extends E> coll) {
         super();
         if (!coll.isEmpty()) {
             root = new AVLNode<E>(coll);

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/list/UnmodifiableList.java Sun Oct 20 21:12:51 2013
@@ -51,9 +51,11 @@ public final class UnmodifiableList<E>
      * @throws IllegalArgumentException if list is null
      * @since 4.0
      */
-    public static <E> List<E> unmodifiableList(final List<E> list) {
+    public static <E> List<E> unmodifiableList(final List<? extends E> list) {
         if (list instanceof Unmodifiable) {
-            return list;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final List<E> tmpList = (List<E>) list;
+            return tmpList;
         }
         return new UnmodifiableList<E>(list);
     }
@@ -64,10 +66,10 @@ public final class UnmodifiableList<E>
      *
      * @param list  the list to decorate, must not be null
      * @throws IllegalArgumentException if list is null
-     * @since Commons Collection 5
      */
-    public UnmodifiableList(final List<E> list) {
-        super(list);
+    @SuppressWarnings("unchecked") // safe to upcast
+    public UnmodifiableList(final List<? extends E> list) {
+        super((List<E>) list);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractHashedMap.java Sun Oct 20 21:12:51 2013
@@ -157,7 +157,7 @@ public class AbstractHashedMap<K, V> ext
      * @param map  the map to copy
      * @throws NullPointerException if the map is null
      */
-    protected AbstractHashedMap(final Map<K, V> map) {
+    protected AbstractHashedMap(final Map<? extends K, ? extends V> map) {
         this(Math.max(2 * map.size(), DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
         _putAll(map);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/AbstractLinkedMap.java Sun Oct 20 21:12:51 2013
@@ -111,7 +111,7 @@ public abstract class AbstractLinkedMap<
      * @param map  the map to copy
      * @throws NullPointerException if the map is null
      */
-    protected AbstractLinkedMap(final Map<K, V> map) {
+    protected AbstractLinkedMap(final Map<? extends K, ? extends V> map) {
         super(map);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/CaseInsensitiveMap.java Sun Oct 20 21:12:51 2013
@@ -105,7 +105,7 @@ public class CaseInsensitiveMap<K, V> ex
      * @param map  the map to copy
      * @throws NullPointerException if the map is null
      */
-    public CaseInsensitiveMap(final Map<K, V> map) {
+    public CaseInsensitiveMap(final Map<? extends K, ? extends V> map) {
         super(map);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/HashedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/HashedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/HashedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/HashedMap.java Sun Oct 20 21:12:51 2013
@@ -81,7 +81,7 @@ public class HashedMap<K, V>
      * @param map  the map to copy
      * @throws NullPointerException if the map is null
      */
-    public HashedMap(final Map<K, V> map) {
+    public HashedMap(final Map<? extends K, ? extends V> map) {
         super(map);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LRUMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LRUMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LRUMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LRUMap.java Sun Oct 20 21:12:51 2013
@@ -141,7 +141,7 @@ public class LRUMap<K, V>
      * @throws NullPointerException if the map is null
      * @throws IllegalArgumentException if the map is empty
      */
-    public LRUMap(final Map<K, V> map) {
+    public LRUMap(final Map<? extends K, ? extends V> map) {
         this(map, false);
     }
 
@@ -156,7 +156,7 @@ public class LRUMap<K, V>
      * @throws IllegalArgumentException if the map is empty
      * @since 3.1
      */
-    public LRUMap(final Map<K, V> map, final boolean scanUntilRemovable) {
+    public LRUMap(final Map<? extends K, ? extends V> map, final boolean scanUntilRemovable) {
         this(map.size(), DEFAULT_LOAD_FACTOR, scanUntilRemovable);
         putAll(map);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LinkedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LinkedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LinkedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/LinkedMap.java Sun Oct 20 21:12:51 2013
@@ -101,7 +101,7 @@ public class LinkedMap<K, V> extends Abs
      * @param map  the map to copy
      * @throws NullPointerException if the map is null
      */
-    public LinkedMap(final Map<K, V> map) {
+    public LinkedMap(final Map<? extends K, ? extends V> map) {
         super(map);
     }
 

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/SingletonMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/SingletonMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/SingletonMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/SingletonMap.java Sun Oct 20 21:12:51 2013
@@ -103,7 +103,7 @@ public class SingletonMap<K, V>
      *
      * @param mapEntry  the mapEntry to use
      */
-    public SingletonMap(final Map.Entry<K, V> mapEntry) {
+    public SingletonMap(final Map.Entry<? extends K, ? extends V> mapEntry) {
         super();
         this.key = mapEntry.getKey();
         this.value = mapEntry.getValue();
@@ -116,12 +116,12 @@ public class SingletonMap<K, V>
      * @throws NullPointerException if the map is null
      * @throws IllegalArgumentException if the size is not 1
      */
-    public SingletonMap(final Map<K, V> map) {
+    public SingletonMap(final Map<? extends K, ? extends V> map) {
         super();
         if (map.size() != 1) {
             throw new IllegalArgumentException("The map size must be 1");
         }
-        final Map.Entry<K, V> entry = map.entrySet().iterator().next();
+        final Map.Entry<? extends K, ? extends V> entry = map.entrySet().iterator().next();
         this.key = entry.getKey();
         this.value = entry.getValue();
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableMap.java Sun Oct 20 21:12:51 2013
@@ -59,9 +59,11 @@ public final class UnmodifiableMap<K, V>
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> Map<K, V> unmodifiableMap(final Map<K, V> map) {
+    public static <K, V> Map<K, V> unmodifiableMap(final Map<? extends K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Map<K, V> tmpMap = (Map<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableMap<K, V>(map);
     }
@@ -73,8 +75,9 @@ public final class UnmodifiableMap<K, V>
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableMap(final Map<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableMap(final Map<? extends K, ? extends V> map) {
+        super((Map<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableOrderedMap.java Sun Oct 20 21:12:51 2013
@@ -57,9 +57,11 @@ public final class UnmodifiableOrderedMa
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> OrderedMap<K, V> unmodifiableOrderedMap(final OrderedMap<K, V> map) {
+    public static <K, V> OrderedMap<K, V> unmodifiableOrderedMap(final OrderedMap<? extends K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final OrderedMap<K, V> tmpMap = (OrderedMap<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableOrderedMap<K, V>(map);
     }
@@ -71,8 +73,9 @@ public final class UnmodifiableOrderedMa
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableOrderedMap(final OrderedMap<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableOrderedMap(final OrderedMap<? extends K, ? extends V> map) {
+        super((OrderedMap<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/map/UnmodifiableSortedMap.java Sun Oct 20 21:12:51 2013
@@ -57,9 +57,11 @@ public final class UnmodifiableSortedMap
      * @throws IllegalArgumentException if map is null
      * @since 4.0
      */
-    public static <K, V> SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, V> map) {
+    public static <K, V> SortedMap<K, V> unmodifiableSortedMap(final SortedMap<K, ? extends V> map) {
         if (map instanceof Unmodifiable) {
-            return map;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final SortedMap<K, V> tmpMap = (SortedMap<K, V>) map;
+            return tmpMap;
         }
         return new UnmodifiableSortedMap<K, V>(map);
     }
@@ -71,8 +73,9 @@ public final class UnmodifiableSortedMap
      * @param map  the map to decorate, must not be null
      * @throws IllegalArgumentException if map is null
      */
-    private UnmodifiableSortedMap(final SortedMap<K, V> map) {
-        super(map);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableSortedMap(final SortedMap<K, ? extends V> map) {
+        super((SortedMap<K, V>) map);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/CircularFifoQueue.java Sun Oct 20 21:12:51 2013
@@ -102,7 +102,7 @@ public class CircularFifoQueue<E> extend
      * @param coll  the collection to copy into the queue, may not be null
      * @throws NullPointerException if the collection is null
      */
-    public CircularFifoQueue(final Collection<E> coll) {
+    public CircularFifoQueue(final Collection<? extends E> coll) {
         this(coll.size());
         addAll(coll);
     }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/queue/UnmodifiableQueue.java Sun Oct 20 21:12:51 2013
@@ -52,9 +52,11 @@ public final class UnmodifiableQueue<E>
      * @return an unmodifiable Queue
      * @throws IllegalArgumentException if queue is null
      */
-    public static <E> Queue<E> unmodifiableQueue(final Queue<E> queue) {
+    public static <E> Queue<E> unmodifiableQueue(final Queue<? extends E> queue) {
         if (queue instanceof Unmodifiable) {
-            return queue;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Queue<E> tmpQueue = (Queue<E>) queue;
+            return tmpQueue;
         }
         return new UnmodifiableQueue<E>(queue);
     }
@@ -66,8 +68,9 @@ public final class UnmodifiableQueue<E>
      * @param queue  the queue to decorate, must not be null
      * @throws IllegalArgumentException if queue is null
      */
-    private UnmodifiableQueue(final Queue<E> queue) {
-        super(queue);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableQueue(final Queue<? extends E> queue) {
+        super((Queue<E>) queue);
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/set/UnmodifiableSet.java Sun Oct 20 21:12:51 2013
@@ -49,9 +49,11 @@ public final class UnmodifiableSet<E>
      * @throws IllegalArgumentException if set is null
      * @since 4.0
      */
-    public static <E> Set<E> unmodifiableSet(final Set<E> set) {
+    public static <E> Set<E> unmodifiableSet(final Set<? extends E> set) {
         if (set instanceof Unmodifiable) {
-            return set;
+            @SuppressWarnings("unchecked") // safe to upcast
+            final Set<E> tmpSet = (Set<E>) set;
+            return tmpSet;
         }
         return new UnmodifiableSet<E>(set);
     }
@@ -63,14 +65,15 @@ public final class UnmodifiableSet<E>
      * @param set  the set to decorate, must not be null
      * @throws IllegalArgumentException if set is null
      */
-    private UnmodifiableSet(final Set<E> set) {
-        super(set);
+    @SuppressWarnings("unchecked") // safe to upcast
+    private UnmodifiableSet(final Set<? extends E> set) {
+        super((Set<E>) set);
     }
 
     //-----------------------------------------------------------------------
     @Override
     public Iterator<E> iterator() {
-        return UnmodifiableIterator.<E>unmodifiableIterator(decorated().iterator());
+        return UnmodifiableIterator.unmodifiableIterator(decorated().iterator());
     }
 
     @Override

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java?rev=1533984&r1=1533983&r2=1533984&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java (original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/trie/UnmodifiableTrie.java Sun Oct 20 21:12:51 2013
@@ -51,7 +51,7 @@ public class UnmodifiableTrie<K, V> impl
      * @return a new unmodifiable trie
      * @throws IllegalArgumentException if trie is null
      */
-    public static <K, V> UnmodifiableTrie<K, V> unmodifiableTrie(final Trie<K, V> trie) {
+    public static <K, V> UnmodifiableTrie<K, V> unmodifiableTrie(final Trie<K, ? extends V> trie) {
         return new UnmodifiableTrie<K, V>(trie);
     }
 
@@ -62,11 +62,13 @@ public class UnmodifiableTrie<K, V> impl
      * @param trie  the trie to decorate, must not be null
      * @throws IllegalArgumentException if trie is null
      */
-    public UnmodifiableTrie(final Trie<K, V> trie) {
+    public UnmodifiableTrie(final Trie<K, ? extends V> trie) {
         if (trie == null) {
             throw new IllegalArgumentException("Trie must not be null");
         }
-        this.delegate = trie;
+        @SuppressWarnings("unchecked") // safe to upcast
+        final Trie<K, V> tmpTrie = (Trie<K, V>) trie;
+        this.delegate = tmpTrie;
     }
 
     //-----------------------------------------------------------------------



Mime
View raw message