Raw types and unchecked casts

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1024471 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Sebastian Bazley 2010-10-20 01:02:09 +00:00
parent a75a36299d
commit 2d69bd58ab
7 changed files with 14 additions and 13 deletions

View File

@ -105,10 +105,10 @@ public class FixedSizeMap<K, 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)
}
//-----------------------------------------------------------------------

View File

@ -106,10 +106,10 @@ public class FixedSizeSortedMap<K, V>
/**
* Read the map in using a custom routine.
*/
@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)
}
//-----------------------------------------------------------------------

View File

@ -132,10 +132,10 @@ public class ListOrderedMap<K, 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)
}
// Implement OrderedMap

View File

@ -157,9 +157,10 @@ public class MultiValueMap<K, V> extends AbstractMapDecorator<K, Object> impleme
* @throws ClassNotFoundException
* @since Commons Collections 3.3
*/
@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, Object>) in.readObject(); // (1)
}
//-----------------------------------------------------------------------

View File

@ -121,10 +121,10 @@ public class PredicatedMap<K, 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)
}
//-----------------------------------------------------------------------

View File

@ -144,10 +144,10 @@ public class TransformedMap<K, 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)
}
//-----------------------------------------------------------------------

View File

@ -94,10 +94,10 @@ public final class UnmodifiableOrderedMap<K, V> extends AbstractOrderedMapDecora
* @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)
}
//-----------------------------------------------------------------------