Summary: | [1.5][compiler] Eclipse JDT allows assignment of inferred type argument which is out of bounds | ||
---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Rene Groeschke <rene> |
Component: | Core | Assignee: | Srikanth Sankaran <srikanth_sankaran> |
Status: | VERIFIED NOT_ECLIPSE | QA Contact: | |
Severity: | normal | ||
Priority: | P3 | CC: | jarthana, Olivier_Thomann |
Version: | 3.6 | ||
Target Milestone: | 3.6 M4 | ||
Hardware: | PC | ||
OS: | Mac OS X - Carbon (unsup.) | ||
Whiteboard: |
Description
Rene Groeschke
2009-11-06 14:41:16 EST
javac7 (b65) compiles it without problems while javac6 and javac5 report the error cited in comment#0 javac b75 compiles it fine too. I meant javac 7 b75 (In reply to comment #0) > User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; de-de) > AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9 > Build Identifier: 20090920-1017 > the following code snippet compiles well in eclipse without any compl aioning,t > but it shouldn 't i guelss: Why exactly do you expect this to fail to compile ? Since List<?> is List of unknown/anything, why should there be an error ? As an aside, (1) javac 5,6,7 compile the following just fine: import java.util.List; public class TestCompiler { public <T extends Foo> List<T> getFoos(){ return null; } public void getFoosCall(){ List<Foo> foos = getFoos(); // used to be List<?> foos = getFoos(); } } class Foo {} (2) Also javac 5,6,7 compile this code fine: import java.util.List; public class TestCompiler <T extends Foo> { public List<T> getFoos(){ return null; } public void getFoosCall(){ List<?> foos = getFoos(); } } class Foo {} We discovered this issue while establishing our continuous integration environment writing ant tasks. I didn't realized, that we actual run our builds only on macosx. Since Apple delivers a self written jdk, I think it is a problem/bug of the macos jdk handling this code different to other JDKs. Tomorrow I will verify this issue on a windows machine using a sun jdk. This is likely a sun bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6315770 fixed and released in 7(b48). Olivier, can I request you to check with 7b47, 7b48 and 7b49 ? (JIM doesn't have these, so I am not able to confirm) I couldn't get hold of b47 and b48, but could test against b46 and b49. The program fails to compile in b46 and compiles alright in b49. Closing this as NOT_ECLIPSE, since this is a javac bug. Verified for 3.6M4 |