Bug 135097 - [override method] provides wrong exception signature with multiple interfaces
Summary: [override method] provides wrong exception signature with multiple interfaces
Status: CLOSED DUPLICATE of bug 129453
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-05 14:08 EDT by Robert Konigsberg CLA
Modified: 2010-04-06 10:45 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Konigsberg CLA 2006-04-05 14:08:11 EDT
Given the following code:

public class DeleteMe implements Type1, Type2 {
  
}
interface Type1 {
  void f() throws CloneNotSupportedException;
}
interface Type2 {
  void f() throws InterruptedException;
}

Navigate the cursor inside Deleteme and Select Source, and then Override/Implement Methods. Select f() and click OK.

The signature for f() should be: void f() { }, not void f() throws CloneNotSupportedException { };

In fact, Eclipse complains: "Exception CloneNotSupportedException is not compatible with throws clause in Type2.f()".

Note that I pulled this code directly from the book Java Puzzlers.
Comment 1 Olivier Thomann CLA 2006-04-05 14:12:20 EDT

*** This bug has been marked as a duplicate of 79798 ***
Comment 2 David Audel CLA 2008-04-29 07:36:37 EDT
This bug is not a duplicate of bug 79798.

'Override/Implement Methods' should insert: 
void f() { }

and not:
void f() throws CloneNotSupportedException { }
Comment 3 David Audel CLA 2008-04-29 07:37:16 EDT
Moving to JDT/UI.
Comment 4 Markus Keller CLA 2010-04-06 10:45:05 EDT

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