Bug 81618 - [1.5][compiler] unsafe type operation warning
Summary: [1.5][compiler] unsafe type operation warning
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Kent Johnson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 79687 82511 82932 83269 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-19 16:19 EST by Joe Bowbeer CLA
Modified: 2005-02-16 05:57 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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