Bug 80099

Summary: [compiler] Erroneus type safety warning
Product: [Eclipse Project] JDT Reporter: Jacopo Torrini <jactor>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Jacopo Torrini CLA 2004-12-03 08:45:22 EST
If you create a generic interface I with T parameter, that has a method M() 
with T return type, and you create a class C implementing the I interface, 
with T gereric parameter assigned to a concrete class (let's suppose String 
object), the overridden method M() in C class (returning a String) is marked 
with a warning: "Type safety: The return type String of the method M() of type 
C needs unchecked conversion to conform to the return type T of inherited 
method"
Comment 1 Jerome Lanneluc CLA 2004-12-09 09:31:47 EST
This is the corresponding test case:

public interface I<T> {
	T m();
}
class C implements I<String> {
	public String m() {
		return "";
	}
}

To investigate ...
Comment 2 Jerome Lanneluc CLA 2004-12-10 12:39:11 EST

*** This bug has been marked as a duplicate of 79687 ***