if (removeCommand.canExecute())
{
removeCommand.execute();
}
else
{
removeCommand = null;
}
if (dragCommand.canExecute())
{
dragCommand.execute();
dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
}
else
{
// Thread.dumpStack();
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/SetCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java
|
Method name: void doExecute()
|
|
Method name: void execute()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 3
|
|
1 | if (removeCommand.canExecute())↵ | | 1 | if (dragCommand.canExecute()) ↵
|
2 | {↵ | | 2 | ↵
|
3 | removeCommand.execute(↵ | | 3 | {↵
|
| | | 4 | dragCommand.execute();↵
|
4 | );↵ | | 5 | dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());↵
|
5 | }↵ | | 6 | ↵
|
6 | ↵ | | 7 | }↵
|
7 | else↵ | | 8 | else↵
|
8 | ↵ | | 9 | ↵
|
9 | {↵ | | 10 | {↵
|
10 | removeCommand = null;↵ | | 11 | ↵
|
11 | ↵ | | 12 | // Thread.dumpStack();↵
|
12 | } | | 13 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.1 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 10 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 2 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
35 | if (removeCommand.canExecute()) | | 3 | if (dragCommand.canExecute()) |
36 | | | 4 | |
| | | 5 | dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult()); |
| | | | |
37 | | | | |
Precondition Violations (0)
Row |
Violation |