Bug 106325 - [1.5][compiler] compiler does not issue unsafe type warning when calling varargs method with parameterized type
Summary: [1.5][compiler] compiler does not issue unsafe type warning when calling vara...
Status: RESOLVED DUPLICATE of bug 128418
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 minor (vote)
Target Milestone: 3.2 M6   Edit
Assignee: JDT-Core-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-08-08 06:00 EDT by Markus Keller CLA
Modified: 2006-03-06 03:17 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 Markus Keller CLA 2005-08-08 06:00:48 EDT
I20050803-0800

The compiler does not issue an unsafe type warning when calling a varargs method
with a parameterized type. See javac's message below. 

import java.lang.ref.WeakReference;
import java.util.Arrays;
import java.util.List;

public class Try {
  void m(WeakReference<Integer> ref) {
    
    List<WeakReference<Integer>> list= Arrays.asList(ref);
    //javac says: warning: [unchecked] unchecked generic array creation of
    //type java.lang.ref.WeakReference<java.lang.Integer>[] for varargs parameter
  }
}
Comment 1 Philipe Mulet CLA 2006-03-06 03:17:57 EST
Added support for varargs generic array creation.
Optional warning issued along with other unchecked ones.

Added GenericTypeTest#test0953

*** This bug has been marked as a duplicate of 128418 ***