Bug 85393 - unecessary cast not reported in conditional expression
Summary: unecessary cast not reported in conditional expression
Status: RESOLVED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-16 07:09 EST by Nikolay Metchev CLA
Modified: 2009-08-30 02:42 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikolay Metchev CLA 2005-02-16 07:09:47 EST
In eclipse 3.1M4 the following code should report an unecessary cast but it
doesn't. It seems that it only doesn't find it if it is in ternary operator:
--------------
import java.util.ArrayList;
import java.util.List;

public class A 
{
   public String method()
   {
      List<String> l = new ArrayList<String>();
      return l == null ? null  : (String) l.get(0);
   }
}
------------------------------------------
Comment 1 Philipe Mulet CLA 2005-02-16 09:29:22 EST
Conditional expression currently do not support unnecessary cast diagnosis.
Comment 2 Philipe Mulet CLA 2005-03-11 10:24:38 EST
defer for now
Comment 3 Eclipse Webmaster CLA 2009-08-30 02:42:47 EDT
As of now 'LATER' and 'REMIND' resolutions are no longer supported.
Please reopen this bug if it is still valid for you.