Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Extract method replacing duplicated code?

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
GennadiyKorol Posted - Sep 12 2008 : 4:36:19 PM
Sometimes when using extract method we already have an almost identical version of the code for the same function somewhere else in the current source file

Simple example:

if (!resource.isReleased() ) {
resource.release();
}


At some point you might want to put this into a method:

void releaseResources()

But at that point you already have those 3 lines of code in multiple places of your file.

It would be nice if VAX would provide a list of "similar" places in your code that can match this procedure and suggest to replace them as well.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Sep 16 2008 : 07:48:34 AM
We are considering having Extract Method search for other instances of the extracted code in the current function, so scanning the whole file is a logical extension:

case=4313

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000