if (analyzeForNonContainment(dropCommand))
{
dropCommand.dispose();
dropCommand = UnexecutableCommand.INSTANCE;
dragCommand.undo();
dragCommand.dispose();
isDragCommandExecuted = false;
dragCommand = IdentityCommand.INSTANCE;
}
if (analyzeForNonContainment(dropCommand))
{
dropCommand.dispose();
dropCommand = UnexecutableCommand.INSTANCE;
dragCommand.undo();
dragCommand.dispose();
isDragCommandExecuted = false;
dragCommand = IdentityCommand.INSTANCE;
}
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/DragAndDropCommand.java
|
Method name: boolean prepareDropCopyInsert(Object, Collection>, int)
|
|
Method name: boolean prepareDropCopyOn()
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (analyzeForNonContainment(dropCommand))↵ | | 1 | if (analyzeForNonContainment(dropCommand))↵
|
2 | {↵ | | 2 | ↵
|
3 | ↵ | | 3 | {↵
|
4 | dropCommand.dispose();↵ | | 4 | dropCommand.dispose();↵
|
5 | dropCommand = UnexecutableCommand.INSTANCE;↵ | | 5 | dropCommand = UnexecutableCommand.INSTANCE;↵
|
|
6 | dragCommand.undo();↵ | | 6 | dragCommand.undo();↵
|
7 | dragCommand.dispose();↵ | | 7 | dragCommand.dispose();↵
|
8 | isDragCommandExecuted = false;↵ | | 8 | isDragCommandExecuted = false;↵
|
9 | dragCommand = IdentityCommand.INSTANCE;↵ | | 9 | dragCommand = IdentityCommand.INSTANCE;↵
|
10 | } | | 10 | }
|
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.2 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 50 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 7 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 6.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if (analyzeForNonContainment(dropCommand)) | | 11 | if (analyzeForNonContainment(dropCommand)) |
16 | | | 12 | |
17 | dropCommand = UnexecutableCommand.INSTANCE; | | 13 | dropCommand = UnexecutableCommand.INSTANCE; |
18 | | | 14 | |
19 | | | 15 | |
20 | isDragCommandExecuted = false; | | 16 | isDragCommandExecuted = false; |
21 | dragCommand = IdentityCommand.INSTANCE; | | 17 | dragCommand = IdentityCommand.INSTANCE; |
Precondition Violations (0)
Row |
Violation |