Community
Participate
Working Groups
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"
This is the corresponding test case: public interface I<T> { T m(); } class C implements I<String> { public String m() { return ""; } } To investigate ...
*** This bug has been marked as a duplicate of 79687 ***