Bug 80099 - [compiler] Erroneus type safety warning
Summary: [compiler] Erroneus type safety warning
Status: RESOLVED DUPLICATE of bug 79687
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-12-03 08:45 EST by Jacopo Torrini CLA
Modified: 2005-01-11 11:05 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 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 ***