Summary: | [1.5][compiler] Generic interface inheritance and overriding error | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Yue Ni <ni2yue4> | ||||||||
Component: | Core | Assignee: | Philipe Mulet <philippe_mulet> | ||||||||
Status: | VERIFIED FIXED | QA Contact: | |||||||||
Severity: | major | ||||||||||
Priority: | P3 | CC: | jerome_lanneluc, kent_johnson, Olivier_Thomann, philippe_mulet | ||||||||
Version: | 3.5 | ||||||||||
Target Milestone: | 3.4.1 | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows Server 2003 | ||||||||||
Whiteboard: | |||||||||||
Attachments: |
|
Reproduced with simple testcase: import java.io.IOException; interface IServiceAction<Response, Request, Fault extends Exception> { Response execute(Request parameter) throws Fault; } interface IServiceOperation<Response, Request, Fault extends Exception> extends IServiceAction<Response, Request, Fault> { Response execute(Request parameter) throws Fault; } public class MyServiceAction { public String execute(String parameter) throws IOException { return serviceOperation.execute(parameter); } private final IServiceOperation<String, String, IOException> serviceOperation = null; } Removing any of the super methods (execute(...)) does make the problem go away. Removing any of the super methods (execute(...)) does make the problem go away. Problem got introduced during 3.4M7 This is another consequence from fix for bug 79798. It was merging exceptions from original methods, instead of substituted parameterized ones; thus surfacing Fault in place of substitute IOException. Created attachment 106709 [details]
Patch for 3.4.x
Need to backport to 3.3.x as well, since fix for 79798 made it there as well. To be released for 3.5M1 too. Created attachment 106710 [details]
Proposed patch
for HEAD
Released for 3.5M1. Added GenericTypeTest#test1366 Released for 3.4.1 Released in 3.3.x maintenance branch (post 3.3.2). Fixed Verified for 3.5M1 using I20080805-1307 Verified for 3.4.1 using M20080827-2000 |
Created attachment 106686 [details] Java source files for this issue Build ID: I20080617-2000 Steps To Reproduce: 1.Create an interface named IServiceAction like below: package com.example.test; public interface IServiceAction<Response, Request, Fault extends Exception> { Response execute(Request parameter) throws Fault; } 2. Create an interface named IServiceOperation like below: package com.example.test; public interface IServiceOperation<Response, Request, Fault extends Exception> extends IServiceAction<Response, Request, Fault> { Response execute(Request parameter) throws Fault; } 3.Create a class named MyServiceAction like below: package com.example.test; import java.io.IOException; public class MyServiceAction { public String execute(String parameter) throws IOException { return serviceOperation.execute(parameter); } private final IServiceOperation<String, String, IOException> serviceOperation = null; } These three classes should be able to be compiled, but in JEE version of Eclipse 3.4, MyServiceAction class failed to be compiled. and the error message is "Unhandled exception type Fault". More information: I have tried to compile them in Eclipse 3.3 and IntelliJ IDEA 7.0.3, and both of them compile these classes without any error.