Fix some generics warnings in test classes.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1475940 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-04-25 20:09:15 +00:00
parent cb3b31ed23
commit b591dacd5c
2 changed files with 5 additions and 6 deletions

View File

@ -81,10 +81,9 @@ public class ReverseComparatorTest extends AbstractComparatorTest<Integer> {
* 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);

View File

@ -237,8 +237,8 @@ public class MultiKeyTest extends TestCase {
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 TestCase {
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));
}
}