Bug 87956

Summary: compiling error on jdk1.5 collection generics
Product: [Eclipse Project] JDT Reporter: Yi-Xiong Zhou <yzhou>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: critical    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Test case none

Description Yi-Xiong Zhou CLA 2005-03-14 13:00:54 EST
The following method overloading will produce a "Duplicate method" error with 
jdk1.5:

    public static String[] convertList(Collection<String> list){
        String[] ret = new String[list.size()];
        Iterator<String> it = list.iterator();
        for( int i=0; it.hasNext(); i++ ){
            ret[i] = it.next();
        }
        return ret;
    }

    public static int[] convertList(Collection<Integer> list){
        int[] ret = new int[list.size()];
        Iterator<Integer> it = list.iterator();
        for( int i=0; it.hasNext(); i++ ){
            ret[i] = (it.next()).intValue();
        }
        return ret;
    }
Comment 1 Olivier Thomann CLA 2005-03-14 13:37:22 EST
Created attachment 18772 [details]
Test case
Comment 2 Kent Johnson CLA 2005-03-14 17:45:57 EST
Added GenericType test561
Comment 3 Olivier Thomann CLA 2005-03-30 19:06:48 EST
Verified in 20050330-0500