Bug 113560

Summary: generic parameter type broke from 3.1.0 to 3.1.1
Product: [Eclipse Project] JDT Reporter: Matthias Brauch <mb>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1.1   
Target Milestone: 3.1.2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Matthias Brauch CLA 2005-10-24 12:09:17 EDT
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( "");
	}

}
Comment 1 Olivier Thomann CLA 2005-10-24 14:25:14 EDT
Might be a dup of bug 112109.
This is fixed in HEAD.
I will add a regression test.
Comment 2 Olivier Thomann CLA 2005-10-24 14:29:06 EDT
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.
Comment 3 Kent Johnson CLA 2005-10-24 14:45:19 EDT
Yes it is - its fixed in HEAD and the 3.1.2 stream

*** This bug has been marked as a duplicate of 112109 ***
Comment 4 Frederic Fusier CLA 2006-01-10 07:59:45 EST
Verified for 3.1.2 using build M20060109-1200.