Bug 69135 - [1.5] Report unnecessary cast for parametrized containers
Summary: [1.5] Report unnecessary cast for parametrized containers
Status: RESOLVED WORKSFORME
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-07-01 10:18 EDT by Martin Aeschlimann 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 Martin Aeschlimann CLA 2004-07-01 10:18:46 EDT
20040701

In the following code the cast to String could be marked as unnecessary.

        ArrayList<String> l= new ArrayList<String>();
        String string = (String) l.get(0);
Comment 1 Philipe Mulet CLA 2004-07-01 11:43:48 EDT
I am already getting the warning:
1. WARNING in X.java (at line 5)
	String string = (String) l.get(0);
                        ^^^^^^^^^^^^^^^^^
Unnecessary cast to type String for expression of type String