Bug 82511 - [1.5] [generics]Erroneous type safety warning
Summary: [1.5] [generics]Erroneous type safety warning
Status: RESOLVED DUPLICATE of bug 81618
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-10 16:33 EST by R Lenard CLA
Modified: 2005-01-11 07:45 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description R Lenard CLA 2005-01-10 16:33:38 EST
This code gives an erroneous type safety error with 3.1M4

% cat Test.java
import java.util.concurrent.Callable;

public class Test
{
    /** A runnable that increments actual call count. **/
    private static final Callable<Integer> toCall = new Callable<Integer>()
    {
        public Integer call()
        {
            return new Integer(5);
        }
    };

}
I get this warning
Type safety: The return type Integer of the method call() of type new 
Callable<Integer>(){} 
 needs unchecked conversion to conform to the return type V of inherited method

Of course there should be no warning/error.
Comment 1 Philipe Mulet CLA 2005-01-11 07:45:32 EST
Dup. 

Kent - you should add this test case to regression suite

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