int index = indexOf(object);
if (index >= 0)
{
remove(index);
return true;
}
else
{
return false;
}
int featureID = eDerivedStructuralFeatureID(eFeature);
if (featureID >= 0)
{
eUnset(featureID);
}
else
{
eOpenUnset(eFeature);
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/BasicEObjectImpl.java
|
Method name: boolean remove(Object)
|
|
Method name: void eUnset(EStructuralFeature)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 4
|
|
1 | int index = indexOf(object);↵ | | 1 | int featureID = eDerivedStructuralFeatureID(eFeature);↵
|
2 | if (index >= 0)↵ | | 2 | if (featureID >= 0)↵
|
3 | {↵ | | 3 | {↵
|
4 | remove(index);↵ | | 4 | ↵
|
5 | return true;↵ | | 5 | eUnset(featureID);↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | return false;↵ | | 9 | eOpenUnset(eFeature);↵
|
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 in different classes |
Number of node comparisons | 13 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 1 |
Number of unmapped statements in the first code fragment | 4 |
Number of unmapped statements in the second code fragment | 3 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
| | | 1 | int featureID = eDerivedStructuralFeatureID(eFeature); |
1 | int index = indexOf(object); | | | |
2 | if (index >= 0) | | 2 | if (featureID >= 0) |
| | | 3 | |
3 | | | | |
4 | | | | |
| | | | |
| | | 4 | |
5 | | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return true; |
2 | Unmatched return false; |