Bug 118349 - 'Add unimplemented methods' quick-fix adds the wrong methods
Summary: 'Add unimplemented methods' quick-fix adds the wrong methods
Status: RESOLVED DUPLICATE of bug 118344
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-28 22:24 EST by Matt Lavin CLA
Modified: 2005-11-28 22:25 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Lavin CLA 2005-11-28 22:24:21 EST
Using 3.2M3, the following steps cause the 'Add unimplemented methods' quick fix to add the wrong methods to my class.

1.  Create a new plug-in project
2.  Add a plugin dependency to 'org.eclipse.team.ui' and save the change.
3.  Add a new class that subclasses 'org.eclipse.team.ui.synchronize.AbstractSynchronizeParticipant' and be sure to un-check the 'Inherited abstract methods' checkbox so that an empty class is created.
4.  Notice that a problem is associated with the file that mentions the missing required methods (this is expected).
5.  Put the cursor on the classname in the editor and use 'Ctrl-1' to bring up the quick fixes and select 'Add unimplemented methods'.

When I follow those steps I get a single method, 'setInitializationData', added to the class which is not the only required method.  'setInitializationData' is actually already implemented by the parent class so it should not be added at all. 

There are other ways to demonstate this problem:

1.  Instead of using the 'Ctrl-1' quickfix thing you can also try to use the Source-> 'Override/Implement Methods...' and notice that the wrong methods are pre-selected (actually even the wrong classes are listed in the dialog, which might be the root of this problem).
2.  Instead of un-selecting the 'Inherited abstract methods' checkbox when the class is created you can leave it selected and notice that it does not create the class with the right methods.

I didn't spend anytime checking whether the problem is related to the project being a plug-in project.  These steps just reflect how I found the problem, so a simpler testcase is probably possible.
Comment 1 Matt Lavin CLA 2005-11-28 22:25:46 EST
I mistakenly pushed refresh in the browser and it cause a second bug submission, sorry.

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