int index = getIndex(cls);
EClass c = classes[index];
if (c == cls)
{
return features[index];
}
int index = getIndex(cls);
EClass c = classes[index];
if (c == cls)
{
return featureKinds[index];
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java
|
Method name: EStructuralFeature[] getFeatures(EClass)
|
|
Method name: int[] getKinds(EClass, EStructuralFeature[])
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | int index = getIndex(cls);↵ | | 1 | int index = getIndex(cls);↵
|
2 | EClass c = classes[index];↵ | | 2 | EClass c = classes[index];↵
|
|
3 | if (c == cls)↵ | | 3 | if (c == cls)↵
|
4 | {↵ | | 4 | {↵
|
5 | return features[index];↵ | | 5 | return featureKinds[index];↵
|
6 | } | | 6 | }
|
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 | 8 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 3 |
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.8 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | int index = getIndex(cls); | | 1 | int index = getIndex(cls); |
2 | EClass c = classes[index]; | | 2 | EClass c = classes[index]; |
3 | if (c == cls) | | 3 | if (c == cls) |
| | | 4 | return featureKinds[index]; |
4 | | | | |
Precondition Violations (1)
Row |
Violation |
1 | Clone fragment #1 returns variables index, c , while Clone fragment #2 returns variables index, c |