Bug 113560 - generic parameter type broke from 3.1.0 to 3.1.1
Summary: generic parameter type broke from 3.1.0 to 3.1.1
Status: VERIFIED DUPLICATE of bug 112109
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1.2   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-10-24 12:09 EDT by Matthias Brauch CLA
Modified: 2006-01-10 07:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.