This commit is contained in:
Sebastian Bazley 2010-10-20 01:02:40 +00:00
parent 2d69bd58ab
commit f6ac90fca9
4 changed files with 7 additions and 6 deletions

View File

@ -78,10 +78,10 @@ public final class UnmodifiableSortedSet<E>
* @throws IOException * @throws IOException
* @throws ClassNotFoundException * @throws ClassNotFoundException
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked") // (1) should only fail if input stream is incorrect
private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException { private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
collection = (Collection) in.readObject(); collection = (Collection<E>) in.readObject(); // (1)
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------

View File

@ -137,10 +137,10 @@ public class TransformedMap<J, K, U, V> extends AbstractIterableGetMapDecorator<
* @throws ClassNotFoundException * @throws ClassNotFoundException
* @since Commons Collections 3.1 * @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 { private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject(); in.defaultReadObject();
map = (Map) in.readObject(); map = (Map<K, V>) in.readObject(); // (1)
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------

View File

@ -108,7 +108,8 @@ class LocalTestNode<K extends Comparable<K>, V extends Comparable<V>> implements
return false; 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()) return (getKey().equals(node.getKey())
&& getValue().equals(node.getValue())); && getValue().equals(node.getValue()));

View File

@ -34,7 +34,7 @@ public abstract class MockTestCase {
private List<Object> mockObjects = new ArrayList<Object>(); private List<Object> mockObjects = new ArrayList<Object>();
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
protected <T> T createMock(Class name) { protected <T> T createMock(Class<?> name) {
T mock = (T) EasyMock.createMock(name); T mock = (T) EasyMock.createMock(name);
return registerMock(mock); return registerMock(mock);
} }