Bug 79346 - [1.5] Incorrect Unsafe type operation message
Summary: [1.5] Incorrect Unsafe type operation message
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 2000
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-23 15:55 EST by Bart Geraci CLA
Modified: 2005-01-11 11:04 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 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!