Bug 63670 - [1.5] Warning Message with ArrayList
Summary: [1.5] Warning Message with ArrayList
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M1   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-24 09:05 EDT by Phuoc Diec CLA
Modified: 2005-01-11 11:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Phuoc Diec CLA 2004-05-24 09:05:24 EDT
Got a warning message when edit a program with ArrayList as below:

ArrayList fileQueue = new ArrayList();
fileQueue.add(new File(startDir));

The warning message is:

Unsafe type operation: Should not invoke the method add(E) of raw type
ArrayList. References to generic type ArrayList<E> should be parameterized.

NOTE: The program was successfully compiled using ant

Eclipse 3M9 with Cheetah on Windows XP SP1.
Eclipse is started with jre 1.4.2_03
Comment 1 Philipe Mulet CLA 2004-05-25 19:32:31 EDT
This is just a warning indicating you that you are using generic types without 
specifying type arguments. ArrayList is now meant to be used as: 
ArrayList<File> in your example. See the 1.5 spec draft about these.

You can turn off this optional warning in the compiler preference page (under 
1.5 tab).