if (validator.isValid(entry.getEStructuralFeature()))
{
if (count == targetIndex)
{
entryTargetIndex = i;
}
if (count == sourceIndex)
{
entrySourceIndex = i;
result = entry.getValue();
}
++count;
}
if (validator.isValid(entry.getEStructuralFeature()))
{
if (count == targetIndex)
{
entryTargetIndex = i;
}
if (count == sourceIndex)
{
entrySourceIndex = i;
result = entry.getValue();
}
++count;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicFeatureMap.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingFeatureMap.java
|
Method name: Object move(EStructuralFeature, int, int)
|
|
Method name: Object move(EStructuralFeature, int, int)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | if (validator.isValid(entry.getEStructuralFeature()))↵ | | 1 | if (validator.isValid(entry.getEStructuralFeature()))↵
|
2 | {↵ | | 2 | {↵
|
3 | if (count == targetIndex)↵ | | 3 | if (count == targetIndex)↵
|
4 | {↵ | | 4 | {↵
|
5 | entryTargetIndex = i;↵ | | 5 | entryTargetIndex = i;↵
|
6 | }↵ | | 6 | }↵
|
7 | if (count == sourceIndex)↵ | | 7 | if (count == sourceIndex)↵
|
8 | {↵ | | 8 | {↵
|
9 | entrySourceIndex = i;↵ | | 9 | entrySourceIndex = i;↵
|
10 | result = entry.getValue();↵ | | 10 | result = entry.getValue();↵
|
11 | }↵ | | 11 | }↵
|
12 | ++count;↵ | | 12 | ++count;↵
|
13 | } | | 13 | }
|
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.5 |
Clones location | Clones are in different classes having the same super class |
Number of node comparisons | 25 |
-
{Non-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) | 0.9 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
10 | if (validator.isValid(entry.getEStructuralFeature())) | | 9 | if (validator.isValid(entry.getEStructuralFeature())) |
11 | if (count == targetIndex) | | 10 | if (count == targetIndex) |
12 | | | 11 | |
13 | if (count == sourceIndex) | | 12 | if (count == sourceIndex) |
14 | | | 13 | |
15 | result = entry.getValue(); | | 14 | result = entry.getValue(); |
16 | | | 15 | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables entryTargetIndex, count, entrySourceIndex, result , while Clone fragment #2 returns variables entryTargetIndex, count, entrySourceIndex, result |