I get tones of exceptions in my code because I tend to use Generics in the old-fashioned way. I have my reasons for that. And I have tons of warnings like those:

  • HashMap is a raw type. References to generic type HashMap should be parameterized
  • Type safety: The method put(Object, Object) belongs to the raw type Map. References to generic type Map should be parameterized


Just because I use to write code like this in java 1.5:

Map parametersMap = new HashMap();
parametersMap.put(properties.get("input.key"), page);

I decided to say, no I don’t want to see them again. You can change the Project Properties in eclipse to ignore them: Right Click on the Project > Java Compiler > Errors / Warnings like in the snapshot (notice you can change this setting only for your specific project or for entire workspace):

Skip eclipse warnings generated by generics

Related Posts

Did you enjoy this tutorial? Be sure to subscribe to the my RSS feed not to miss my new posts!
... or make it popular on