Bug 90438

Summary: [compiler][1.5] Two problems: Automatically generated method has wrong generic type; Compilation error with JDK
Product: [Eclipse Project] JDT Reporter: Volker Renneberg <volker.renneberg.external>
Component: CoreAssignee: Kent Johnson <kent_johnson>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.1   
Target Milestone: 3.2 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Volker Renneberg CLA 2005-04-06 08:29:13 EDT
Hi!

This example covers two problems of Eclipse 3.1M6. The following code contains 
and internal class "MyInterfaceImpl" implementing the interface "MyInterface". 
If you leave out the necessary implementation of the method and ask Eclipse to 
generate a default implementation (as a solution for the error), the shown 
method will be generated:

       public <A extends Object & Data> void copyData(A data) {

although the signature should be

       public <A extends Data> void copyData(A data) {

Furthermore, the generated code does compile with Eclipse, Although it does 
not compile with the Javac compiler JDK 1.5 (update 2)
public class ExtendedGenericMethodSignature {
    public interface Data {
    }

    public interface MyInterface {
        public <A extends Data> void copyData(A data);
    }

    public class MyInterfaceImpl implements MyInterface {
        public <A extends Object & Data> void copyData(A data) {
        }
    }
}

Javac says:
ExtendedGenericMethodSignature.MyInterfaceImpl is not abstract and does not 
override abstract method <A>copyData(A) in 
ExtendedGenericMethodSignature.MyInterface.
Comment 1 Jerome Lanneluc CLA 2006-03-28 10:23:21 EST
Verified that the generated code is now as expected.
However we still have a different behavior than javac.
Comment 2 Philipe Mulet CLA 2006-04-04 09:23:53 EDT
Method verifier issue.

Comment 3 Philipe Mulet CLA 2006-04-21 09:33:07 EDT
+1 for 3.2RC2
Comment 4 Kent Johnson CLA 2006-04-21 13:32:55 EDT
Added MethodVerifier test86
Comment 5 Olivier Thomann CLA 2006-04-28 15:01:28 EDT
Verified with I20060427-1600 for 3.2RC2