Bug 76780

Summary: [model] return type not recognized correctly on some generic methods
Product: [Eclipse Project] JDT Reporter: Jing Xue <jxue01>
Component: CoreAssignee: Jerome Lanneluc <jerome_lanneluc>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.1 M3   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Proposed fix
none
Proposed regression test none

Description Jing Xue CLA 2004-10-21 19:27:24 EDT
This is 3.1 M2.

Given the following interface and class:

public interface Interface
{
    public <T extends Interface> T[] foo(Class<T> c);
}

public class Impl implements Interface
{
    public <T extends Interface> T[] foo(Class<T> c)
                                     ~~~~~~~~~~~~~~~
    {
        return null;
    }
}

The editor underlines the implementation method (as shown above) and complains
"The return type is incompatible with Interface.foo(Class<T>)".  However the
Problems View does not show the error, and this code compiles successfully on
command line.
Comment 1 Jerome Lanneluc CLA 2004-10-22 04:47:49 EDT
Suspecting SourceTypeConverter that doesn't recreate the correct ast.
Comment 2 Jerome Lanneluc CLA 2004-11-03 07:37:24 EST
Problem is in SourceTypeConverter#createTypeParameter(...) that doesn't set the
type field on the TypeParameter.
Comment 3 Jerome Lanneluc CLA 2004-11-03 09:25:10 EST
Created attachment 15600 [details]
Proposed fix
Comment 4 Jerome Lanneluc CLA 2004-11-03 09:25:33 EST
Created attachment 15601 [details]
Proposed regression test
Comment 5 Philipe Mulet CLA 2004-11-03 16:26:23 EST
Ok for including in M3
Comment 6 Jerome Lanneluc CLA 2004-11-04 05:35:16 EST
Released proposed patch and regression test.
Comment 7 Frederic Fusier CLA 2004-11-04 10:20:38 EST
Verified for 3.1 M3 with build I200411040010 + jdt.core HEAD