Bug 294944

Summary: [1.5][compiler] Missing unchecked conversion warning
Product: [Eclipse Project] JDT Reporter: Srikanth Sankaran <srikanth_sankaran>
Component: CoreAssignee: Srikanth Sankaran <srikanth_sankaran>
Status: VERIFIED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: jarthana
Version: 3.5   
Target Milestone: 3.6 M4   
Hardware: PC   
OS: Windows XP   
Whiteboard:

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