Bug 87995

Summary: Spurious warning with generics (maybe)
Product: [Eclipse Project] JDT Reporter: David Mandelin <mandelin>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description David Mandelin CLA 2005-03-14 17:45:23 EST
The code below gives me a warning. I don't see why there should be a warning, so
I'm guessing it's spurious. I fed it through javac and didn't get a warning, FWIW.

The warning:
Type safety: The return type Integer of the method get(Class<Integer>) of type
Test.Bar needs unchecked conversion to conform to the return type T of inherited
method.

The code:
public class Test {
interface IFoo<T> {
    public T get(Class<T> clazz);
}

class Bar implements IFoo<Integer> {
    public Integer get(Class<Integer> arg0) {
        return new Integer(3);
    }
}
}
Comment 1 Adam Kiezun CLA 2005-03-15 19:24:07 EST
dup of bug 79687
Comment 2 Philipe Mulet CLA 2005-03-16 04:42:32 EST
Added GenericTypeTest#test565

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