Bug 82511

Summary: [1.5] [generics]Erroneous type safety warning
Product: [Eclipse Project] JDT Reporter: R Lenard <rlenard>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: kent_johnson
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

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 ***