Community
Participate
Working Groups
The following example works with 3.1 as well as with the JDK 1.5.0_05-b05's javac. In Eclipse 3.1.1 the code does not compile: interface ExtCloneable extends Cloneable { public ExtCloneable clone( String arg) throws CloneNotSupportedException; } public class Tester { public static <V extends ExtCloneable> ExtCloneable cloneItem1( V value) throws CloneNotSupportedException { /* * Compile-Time-Error with Eclipse 3.1.1: * The method clone() in the type Object is not applicable for the arguments (String) */ return value.clone( ""); } public static <V extends ExtCloneable> ExtCloneable cloneItem2( ExtCloneable value) throws CloneNotSupportedException { return value.clone( ""); } public static <V extends ExtCloneable> ExtCloneable cloneItem3( V value) throws CloneNotSupportedException { return ((ExtCloneable)value).clone( ""); } }
Might be a dup of bug 112109. This is fixed in HEAD. I will add a regression test.
Added org.eclipse.jdt.core.tests.compiler.regression.GenericTypeTest.test858. Kent, is this a dup of bug 112109. This is not fixed in v_617, but it is in HEAD.
Yes it is - its fixed in HEAD and the 3.1.2 stream *** This bug has been marked as a duplicate of 112109 ***
Verified for 3.1.2 using build M20060109-1200.