warning messages:"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized"

heyday2004
heyday2004 used Ask the Experts™
on

I use Eclipse to compile a java project, I got several thousands of  this kind of warning messages:"ArrayList is a raw type. References to generic type ArrayList<E> should be parameterized"

What should I do to eliminate this kind of warning messages? Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mick BarryJava Developer
Top Expert 2010
Commented:
Specify the type of object that will be staored in the list

ArrayList x = new ArrayList();
Commented:
You can either add a @SuppressWarnings("unchecked") annotation on the methods or variables that cause these warnings, or go to Window-Preferences-Java-Compiler-Errors/Warnings and in the right panel select "Annotations" item and select Ignore from the list labeled "Unused 'SuppressWarnings' token"
Commented:
Sorry, you can ignore the second option above. Only the first one is valid.
Yes, Java Zone must accept Objects comment only
Otherwise, may get terrible
Commented:
heymanalias,

I have referred to my second option included in the my first comment :-). Nothing in common with objects' comment.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial