You've done nothing wrong; all pre-Tiger Java code of any complexity will elicit these warnings when compiled with JDK 1.5. What's happened is that there is a new way to use the container classes. Here is a document that will introduce you to generics.
Note that you can't have it both ways! Code that won't give these warnings under Tiger, won't compile at all under older JDKs. This is an irreversible change once you start down that road.