Community
Participate
Working Groups
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); }
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.
Verified for 3.6M4