Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 210297

Summary: cleanup code duplication between this and BugzillaTaskEditor
Product: z_Archived Reporter: Frank Becker <eclipse>
Component: MylynAssignee: Robert Elves <robert.elves>
Status: RESOLVED DUPLICATE QA Contact:
Severity: normal    
Priority: P3 CC: mjmeijer
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
mylyn/context/zip none

Description Frank Becker CLA 2007-11-19 15:04:27 EST
I found the following Tasks

FIXME : A lot of duplicated code here between this and BugzillaTaskEditor
FIXME : A lot of duplicated code here between this and NewBugzillataskEditor

because I create the two Methods my question is should I look at this.

The reason for this is that I don't know if it is allow to put Bugzilla specific code in AbstractRepositoryTaskEditor.

Why are there two Classes AbstractNewRepositoryTaskEditor and AbstractRepositoryTaskEditor with overwrite of not needed Methods for AbstractNewRepositoryTaskEditor and not one Class with switch of not needed code by taskData.isNew().
Comment 1 Frank Becker CLA 2007-11-19 15:07:19 EST
Created attachment 83272 [details]
mylyn/context/zip
Comment 2 maarten meijer CLA 2007-11-20 05:41:49 EST
I noticed the same thing when working on bug 161646: support for Clone this bug.
Here we have a conflict between 'Replace conditional logic with polymorphism' and the 'duplicated code' smell ;-0

Also see bug 179254: [api] AbstractRepositoryTaskEditor needs to be decomposed
That one is scheduled for 3.0

> The reason for this is that I don't know if it is allow to put Bugzilla specific code in AbstractRepositoryTaskEditor.
I think that is not a very good idea.
Comment 3 Steffen Pingel CLA 2007-11-21 17:45:48 EST
Thank you for the comments. Yes, Bugzilla specific code should only go into the editor implementation that is part of the Bugzilla connector. 

As Maarten has pointed out we will review the current editor implementation for the 3.0 cycle and plan to do a larger refactoring of the code. For now it is okay to duplicate code to maintain API backwards compatibility as long as this is noted in a comment.

Let's track suggestions for improvements to the current architecture on bug 179254 .

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