if (analyzeForNonContainment(dropCommand))
{
dropCommand.dispose();
dropCommand = UnexecutableCommand.INSTANCE;
dragCommand = IdentityCommand.INSTANCE;
}
else
{
dragCommand = RemoveCommand.create(domain, collection);
}
if (analyzeForNonContainment(dropCommand))
{
dropCommand.dispose();
dropCommand = UnexecutableCommand.INSTANCE;
dragCommand = IdentityCommand.INSTANCE;
}
else
{
dragCommand = RemoveCommand.create(domain, collection);
}
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 prepareDropMoveInsert(Object, Collection>, int)
|
|
Method name: boolean prepareDropMoveOn()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | if (analyzeForNonContainment(dropCommand))↵ | | 1 | if (analyzeForNonContainment(dropCommand))↵
|
2 | {↵ | | 2 | {↵
|
3 | dropCommand.dispose();↵ | | 3 | dropCommand.dispose();↵
|
4 | dropCommand = UnexecutableCommand.INSTANCE;↵ | | 4 | dropCommand = UnexecutableCommand.INSTANCE;↵
|
5 | dragCommand = IdentityCommand.INSTANCE;↵ | | 5 | dragCommand = IdentityCommand.INSTANCE;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | dragCommand = RemoveCommand.create(domain, collection);↵ | | 9 | dragCommand = RemoveCommand.create(domain, collection);↵
|
10 | } | | 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 declared in the same class |
Number of node comparisons | 26 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 5 |
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) | 1.2 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
27 | if (analyzeForNonContainment(dropCommand)) | | 5 | if (analyzeForNonContainment(dropCommand)) |
28 | | | 6 | |
29 | dropCommand = UnexecutableCommand.INSTANCE; | | 7 | dropCommand = UnexecutableCommand.INSTANCE; |
30 | dragCommand = IdentityCommand.INSTANCE; | | 8 | dragCommand = IdentityCommand.INSTANCE; |
| | | | |
31 | dragCommand = RemoveCommand.create(domain, collection); | | 9 | dragCommand = RemoveCommand.create(domain, collection); |
Precondition Violations (1)
Row |
Violation |
1 | Type java.util.Collection<> of variable collection does not match with type java.util.Collection<> of variable collection |