You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by tn...@apache.org on 2013/04/25 22:09:27 UTC

svn commit: r1475940 - in /commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4: comparators/ReverseComparatorTest.java keyvalue/MultiKeyTest.java

Author: tn
Date: Thu Apr 25 20:09:15 2013
New Revision: 1475940

URL: http://svn.apache.org/r1475940
Log:
Fix some generics warnings in test classes.

Modified:
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java
    commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java?rev=1475940&r1=1475939&r2=1475940&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/comparators/ReverseComparatorTest.java Thu Apr 25 20:09:15 2013
@@ -81,10 +81,9 @@ public class ReverseComparatorTest exten
      * already "canonized" the comparator returned by makeComparator.
      */
     @Override
-    @SuppressWarnings("unchecked")
     @Test
     public void testSerializeDeserializeThenCompare() throws Exception {
-        final Comparator comp = new ReverseComparator(new ComparableComparator());
+        final Comparator<?> comp = new ReverseComparator<String>(new ComparableComparator<String>());
 
         final ByteArrayOutputStream buffer = new ByteArrayOutputStream();
         final ObjectOutputStream out = new ObjectOutputStream(buffer);

Modified: commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java?rev=1475940&r1=1475939&r2=1475940&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java (original)
+++ commons/proper/collections/trunk/src/test/java/org/apache/commons/collections4/keyvalue/MultiKeyTest.java Thu Apr 25 20:09:15 2013
@@ -237,8 +237,8 @@ public class MultiKeyTest extends TestCa
     public void testEqualsAfterSerialization() throws IOException, ClassNotFoundException
     {
         SystemHashCodeSimulatingKey sysKey = new SystemHashCodeSimulatingKey("test");
-        final MultiKey mk = new MultiKey(ONE, sysKey);
-        final Map map = new HashMap();
+        final MultiKey<?> mk = new MultiKey<Object>(ONE, sysKey);
+        final Map<MultiKey<?>, Integer> map = new HashMap<MultiKey<?>, Integer>();
         map.put(mk, TWO);
 
         // serialize
@@ -252,12 +252,12 @@ public class MultiKeyTest extends TestCa
         final ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
         final ObjectInputStream in = new ObjectInputStream(bais);
         sysKey = (SystemHashCodeSimulatingKey)in.readObject(); // simulate deserialization in another process
-        final Map map2 = (Map) in.readObject();
+        final Map<?, ?> map2 = (Map<?, ?>) in.readObject();
         in.close();
 
         assertEquals(2, sysKey.hashCode()); // different hashCode now
 
-        final MultiKey mk2 = new MultiKey(ONE, sysKey);
+        final MultiKey<?> mk2 = new MultiKey<Object>(ONE, sysKey);
         assertEquals(TWO, map2.get(mk2));        
     }
 }