commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1024472 - in /commons/proper/collections/trunk/src: java/org/apache/commons/collections/set/ java/org/apache/commons/collections/splitmap/ test/org/apache/commons/collections/
Date Wed, 20 Oct 2010 01:02:40 GMT
Author: sebb
Date: Wed Oct 20 01:02:40 2010
New Revision: 1024472

URL: http://svn.apache.org/viewvc?rev=1024472&view=rev
Log: (empty)

Modified:
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java
    commons/proper/collections/trunk/src/java/org/apache/commons/collections/splitmap/TransformedMap.java
    commons/proper/collections/trunk/src/test/org/apache/commons/collections/LocalTestNode.java
    commons/proper/collections/trunk/src/test/org/apache/commons/collections/MockTestCase.java

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java?rev=1024472&r1=1024471&r2=1024472&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/set/UnmodifiableSortedSet.java
Wed Oct 20 01:02:40 2010
@@ -78,10 +78,10 @@ public final class UnmodifiableSortedSet
      * @throws IOException
      * @throws ClassNotFoundException
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked") // (1) should only fail if input stream is incorrect 
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
         in.defaultReadObject();
-        collection = (Collection) in.readObject();
+        collection = (Collection<E>) in.readObject(); // (1)
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/java/org/apache/commons/collections/splitmap/TransformedMap.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/java/org/apache/commons/collections/splitmap/TransformedMap.java?rev=1024472&r1=1024471&r2=1024472&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/java/org/apache/commons/collections/splitmap/TransformedMap.java
(original)
+++ commons/proper/collections/trunk/src/java/org/apache/commons/collections/splitmap/TransformedMap.java
Wed Oct 20 01:02:40 2010
@@ -137,10 +137,10 @@ public class TransformedMap<J, K, U, V> 
      * @throws ClassNotFoundException
      * @since Commons Collections 3.1
      */
-    @SuppressWarnings("unchecked")
+    @SuppressWarnings("unchecked") // (1) should only fail if input stream is incorrect 
     private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException
{
         in.defaultReadObject();
-        map = (Map) in.readObject();
+        map = (Map<K, V>) in.readObject(); // (1)
     }
 
     //-----------------------------------------------------------------------

Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/LocalTestNode.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/LocalTestNode.java?rev=1024472&r1=1024471&r2=1024472&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/org/apache/commons/collections/LocalTestNode.java
(original)
+++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/LocalTestNode.java
Wed Oct 20 01:02:40 2010
@@ -108,7 +108,8 @@ class LocalTestNode<K extends Comparable
             return false;
         }
 
-        LocalTestNode node = (LocalTestNode) o;
+        @SuppressWarnings("unchecked") // o has the correct class - see above
+        LocalTestNode<K, V> node = (LocalTestNode<K, V>) o;
 
         return (getKey().equals(node.getKey())
                 && getValue().equals(node.getValue()));

Modified: commons/proper/collections/trunk/src/test/org/apache/commons/collections/MockTestCase.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/org/apache/commons/collections/MockTestCase.java?rev=1024472&r1=1024471&r2=1024472&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/org/apache/commons/collections/MockTestCase.java
(original)
+++ commons/proper/collections/trunk/src/test/org/apache/commons/collections/MockTestCase.java
Wed Oct 20 01:02:40 2010
@@ -34,7 +34,7 @@ public abstract class MockTestCase {
     private List<Object> mockObjects = new ArrayList<Object>();
 
     @SuppressWarnings("unchecked")
-    protected <T> T createMock(Class name) {
+    protected <T> T createMock(Class<?> name) {
         T mock = (T) EasyMock.createMock(name);
         return registerMock(mock);
     }



Mime
View raw message