Bug 81727

Summary: [1.5] Redundant warning of parameterized return type
Product: [Eclipse Project] JDT Reporter: baikuo21
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: All   
Whiteboard:

Description baikuo21 CLA 2004-12-21 08:16:08 EST
Version: 3.1M4 (or others ?)

interface Foo<T extends Foo> {
	T foo();
}

class FooImpl implements Foo<FooImpl> {
	public FooImpl foo() { // Here I get a warning
		return null;
	}
}

Here is the warning JDT reported:

Type safety: The return type FooImpl of the method foo() of type FooImpl needs
unchecked conversion to conform to the return type T of inherited method

According to the draft of the JLS 3rd edition and the javac (of Sun jdk1.5.0),
there should be no error or warning.
Comment 1 Frederic Fusier CLA 2004-12-27 05:24:22 EST
Please do not change our prefix in summary. This is our internal way to classify
them. This 1.5 because this classification was done before 1.5 becomes 5.0. If
you change it, our bugzilla requests will not return the right list and your bug
may be missed...
Also do not change target, this is owner responsibility. When it will be set,
this informs you in which milestone this bug will be fixed...
Thanks
Comment 2 Kent Johnson CLA 2005-01-04 15:37:42 EST
This was fixed just after M4.

Added MethodVerify test028.
Comment 3 David Audel CLA 2005-02-15 12:39:43 EST
Verified in I20050214-0927