Bug 294944 - [1.5][compiler] Missing unchecked conversion warning
Summary: [1.5][compiler] Missing unchecked conversion warning
Status: VERIFIED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.5   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M4   Edit
Assignee: Srikanth Sankaran CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-12 03:19 EST by Srikanth Sankaran CLA
Modified: 2009-12-08 03:55 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Srikanth Sankaran CLA 2009-11-12 03:19:38 EST
3.6M3
The following programs generates an unchecked warning while compiled with
javac and the warning is missing with eclipse compiler.

class Test<X> {
	X m(Class<X> c) {return null;}
	X x = m((Class)String.class);
}
Comment 1 Srikanth Sankaran CLA 2009-11-24 06:16:54 EST
Actually, comment#0 is incorrect. The unchecked warning does appear
with that test case. The real bug with that test case was that it
is not supposed to compile at all per JLS 15.12.2.6.

See http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6791481

See also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=277643

In the latter case, we are aligning with javac even when it is
known that eclipse behavior is correct and is a strict interpretation
of JLS - this is so as to allow code that compiles with javac to
also compile with ecj (in cases where it is known that javac is
defective, but the defect is not likely to be fixed)

In the current bug which is related to JLS 15.12.2.6, ecj behavior
is already aligned with javac. So closing this as WONT FIX.
Comment 2 Jay Arthanareeswaran CLA 2009-12-08 03:48:18 EST
Verified for 3.6M4