Bug 87995 - Spurious warning with generics (maybe)
Summary: Spurious warning with generics (maybe)
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 minor (vote)
Target Milestone: 3.1 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-03-14 17:45 EST by David Mandelin CLA
Modified: 2005-03-16 04:42 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 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 ***