Generics in Java is noisy sometimes. The parameterized types are thrown out by the compiler anyway after compile, so my question is, is there really any drawbacks in ignoring them, as long as I declare the type of the reference to include parameterized types? e.g.,
Map<String, Map<Integer, String>> myMap = new HashMap<String, Map<Integer,String>>();
is just too noisy. What if I write:
@SuppressWarnings("unchecked")
Map<String, Map<Integer, String>> myMap = new HashMap();
It's so much clearer, except that Eclipse will put a disgusting wavy line under it. Put @SuppressWarning will make Eclipse happy, but many people (including me) don't like to sprinkle @SuppressWarning in the code. Is it really that bad to ignore the type parameters in "new HashMap()"?