Comments (6)
I first made an Eclipse Java project (File -> New -> Java Project) with the source code you provided.
Then in the Package Explorer view (Java Perspective), I selected both methods (by holding down Ctrl),
and right-clicked on them. A pop-up menu appears and you select "Refactor Duplicated code".
Alternatively, you can import results from NiCad or other clone detectors.
From the Bad Smells menu, click Duplicated Code to open the view.
The view has an import button (i) that opens the Import wizard.
Select the project in the Package Explorer and click on the import button.
In the wizard you should browse to the *-classes.xml file exported by NiCad
(for example _blocks-blind-clones-0.2-classes.xml)
After parsing the file, the clone groups will appear in the Duplicated code view.
You can scroll up/down to find the clone group corresponding to these methods.
Select the two clones in the group holding down Ctrl, right click, and then Refactor.
from jdeodorant.
Please report the project (repository or link to download) and the exact clone fragments you tried to refactor.
from jdeodorant.
Project -> https://github.com/prabh27/DuplicateCodeAntipattern1
Functions that are cloned are: shift, shift2.
NiCad detects the functions, but when I select both the clones and click on refactor, nothing happens. I am using a 64-bit Mac.
from jdeodorant.
You need to setup your code as an Eclipse Java project. It works fine. See screenshot below.
from jdeodorant.
Unable to do it. I followed the steps given in the video.
Could you please tell me the steps that you followed?
from jdeodorant.
old but gold. Thank you @tsantalis
I had the same issue.
from jdeodorant.
Related Issues (20)
- Problem in parsing cloneDR results folrder in Eclipse-JDeodorant-Plugin HOT 2
- Add developer guide to the README file
- Support Intellij IDEA
- Duplicated code and project not compiling after refactoring Long Method. HOT 4
- Extracted method after refactoring Long Method throws an exception not thrown in the original code. HOT 3
- NPE (JFreeChart - CCFInderX) HOT 3
- ReplaceTypeCodeWithStateStrategy refactoring does not modify all type-field accesses
- Wrong field's access in Extract Class refactoring.
- Wrong access of field instance of the class itself in Extract Class refactoring
- Wrong order of original class field initializers in Product class for Extract Class Refactoring
- Extract Class refactoring does not support final initialization with a field or a static function call. HOT 2
- Unexpected exception in Extract Class refactoring with final fields HOT 3
- Plug-in "ca.concordia.jdeodorant.eclipse.commandline-lambda" was unable to instantiate class "ca.concordia.jdeodorant.eclipse.commandline.Application". HOT 8
- Stackoverflow error when running JDeodorant on OpenMap HOT 3
- NullPointerException when reviewing CCFinderX inputs
- Using Multiple Smell Scans leads to "Incomprehensible Rainbow" Documents 🌈 HOT 3
- Compilation error after refactoring God Class using JDeodorant HOT 1
- Cannot start identify process HOT 2
- JDeodorant added to ProductHunt HOT 1
- JDeodorant used for Java1.8 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jdeodorant.