Bug 79346

Summary: [1.5] Incorrect Unsafe type operation message
Product: [Eclipse Project] JDT Reporter: Bart Geraci <BJGeraci>
Component: CoreAssignee: JDT-Core-Inbox <jdt-core-inbox>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows 2000   
Whiteboard:

Description Bart Geraci CLA 2004-11-23 15:55:26 EST
Eclipse version 3.1.0, build 200411230838

Given the following code below
  plus 
Java 5.0 compiler option: 
"Unsafe type operation involving raw types" - set to "Warning" 

=====================
interface F<A,B> { 
  B something(A x);
}

public class Test1 {

  public static void main(String[] args) {
    F<String, Integer> res = new F<String, Integer>() {
      public Integer something(String arg0) {
        // "Integer" is highlighted on the previous line as a warning. 
        return new Integer(0);
      }
    };
    Integer x = res.something("demo");
  }
}
=================

and the warning message is: 

"Type safety: The return type Integer of the method something(String) of type
new F<String,Integer>(){} needs unchecked conversion to conform to the return
type B of inherited method"

This shouldn't need a conversion. This also appears if F is declared as an 
abstract class as well.
Comment 1 Jerome Lanneluc CLA 2004-12-10 12:57:26 EST

*** This bug has been marked as a duplicate of 79687 ***
Comment 2 Bart Geraci CLA 2005-01-04 16:17:34 EST
As of the I20050104-1300 build, it no longer gives me the warning. Thanks!