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:
parent
a75a36299d
commit
2d69bd58ab
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue