K
Knute Johnson
How do you prevent unchecked cast warning when you read a parameterized
object from an ObjectInputStream? If TreeMap isn't parameterized then
this doesn't happen but that isn't really a good solution. Or should I
just ignore this?
The TreeMap in this case is TreeMap<String,Boolean>.
C:\>javac -Xlint:unchecked
com/knutejohnson/smallbook/sportsnetwork/TickerClient.java
com\knutejohnson\smallbook\sportsnetwork\TickerClient.java:390: warning:
[unchecked] unchecked cast found : java.lang.Object
required: java.util.TreeMap<java.lang.String,java.lang.Boolean>
map = (TreeMap<String,Boolean>)ois.readObject();
^
1 warning
Thanks,
object from an ObjectInputStream? If TreeMap isn't parameterized then
this doesn't happen but that isn't really a good solution. Or should I
just ignore this?
The TreeMap in this case is TreeMap<String,Boolean>.
C:\>javac -Xlint:unchecked
com/knutejohnson/smallbook/sportsnetwork/TickerClient.java
com\knutejohnson\smallbook\sportsnetwork\TickerClient.java:390: warning:
[unchecked] unchecked cast found : java.lang.Object
required: java.util.TreeMap<java.lang.String,java.lang.Boolean>
map = (TreeMap<String,Boolean>)ois.readObject();
^
1 warning
Thanks,