Bug 81618

Summary: [1.5][compiler] unsafe type operation warning
Product: [Eclipse Project] JDT Reporter: Joe Bowbeer <joe.bowbeer>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: eclipse.org, lbloom, qualidafial, rlenard
Version: 3.1   
Target Milestone: 3.1 M5   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Joe Bowbeer CLA 2004-12-19 16:19:26 EST
The following code triggers a type warning in Eclipse 3.1M4.
Neither Eclipse 3.1M3 nor javac emit a warning, nor should they.

import java.util.concurrent.Callable;
public class TypeWarningBug {
  public static void main(String[] args) throws Exception {
    Callable<Integer> integerCallable = new Callable<Integer>() {
      public Integer call() {
        return new Integer(1);
      }
    };
    System.out.println(integerCallable.call());
  }
}

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

To silence, disable "Unsafe type operation involving raw types" in JSK 5.0
compiler options.
Comment 1 Kent Johnson CLA 2004-12-21 16:02:45 EST
Added MethodVerify test025
Comment 2 Philipe Mulet CLA 2005-01-11 07:45:33 EST
*** Bug 82511 has been marked as a duplicate of this bug. ***
Comment 3 Kent Johnson CLA 2005-01-11 10:58:17 EST
*** Bug 79687 has been marked as a duplicate of this bug. ***
Comment 4 Jerome Lanneluc CLA 2005-01-17 04:27:34 EST
*** Bug 82932 has been marked as a duplicate of this bug. ***
Comment 5 Matthew Hall CLA 2005-01-19 22:47:23 EST
*** Bug 83269 has been marked as a duplicate of this bug. ***
Comment 6 David Audel CLA 2005-02-16 05:57:56 EST
Verified in I20050215-2300