Originally posted by Jeroen T Wenting:
You don't use genericised collections.
Your Vector stores something of class A with keys of class B.
Define it as Vector<B, A> rather than Vector.
I think Jeroen was in a hurry when posting this
I'm sure he meant use HashMap<A, B> rather than vector<A,B>. The vector definition would be vector<A> for some classes A.
So for example, use HashMap<
String, Integer> map = new HashMap<String, Integer>(); or vector<String> myList = new Vector<String>();
You should find that you can get rid of some casts when you get elements out of such collections. If you are using Iterators you should declare them with the appropriate type. For instance Iterator<String> when iterating over an ArrayList<String>.
There's lots more but the above should help you get rid of a few of those warnings.