if (dragCommand.canExecute())
{
dragCommand.execute();
dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());
}
else
{
// Thread.dumpStack();
}
if (command.canExecute())
{
command.execute();
}
else
{
// Thread.dumpStack();
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/DragAndDropCommand.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/edit/command/PasteFromClipboardCommand.java
|
Method name: void execute()
|
|
Method name: void doExecute()
|
Number of AST nodes: 3
|
|
Number of AST nodes: 2
|
|
1 | if (dragCommand.canExecute()) ↵ | | 1 | if (command.canExecute())↵
|
2 | ↵ | | |
|
3 | {↵ | | 2 | {↵
|
4 | dragCommand.execute();↵ | | 3 | command.execute();↵
|
5 | dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult());↵ | | 4 | ↵
|
6 | }↵ | | |
|
7 | ↵ | | 5 | } ↵
|
8 | else ↵ | | 6 | else↵
|
9 | ↵ | | |
|
10 | {↵ | | 7 | ↵
|
11 | ↵ | | 8 | {↵
|
12 | // Thread.dumpStack();↵ | | 9 | // Thread.dumpStack();↵
|
13 | } | | 10 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
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 | 6 |
-
{Non-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 | 0 |
Time elapsed for statement mapping (ms) | 0.5 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (dragCommand.canExecute()) | | 1 | if (command.canExecute()) |
4 | | | 2 | |
5 | dropCommand = AddCommand.create(domain, optimizedDropCommandOwner, null, dragCommand.getResult()); | | | |
Precondition Violations (2)
Row |
Violation |
1 | Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command |
2 | Type org.eclipse.emf.common.command.Command of variable dragCommand does not match with type org.eclipse.emf.common.command.StrictCompoundCommand of variable command |