List<EStructuralFeature> allElements = getAllElements(eClass);
for (int i = 0, size = allElements.size(); i < size; ++i)
{
EStructuralFeature result = allElements.get(i);
if (matches(getWildcards(result), namespace))
{
return result;
}
}
List<EStructuralFeature> allElements = getAllElements(eClass);
for (int i = 0, size = allElements.size(); i < size; ++i)
{
EStructuralFeature result = allElements.get(i);
if (matches(getWildcards(result), namespace))
{
return result;
}
}
return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
|
Method name: EStructuralFeature getAffiliation(EClass, EStructuralFeature)
|
|
Method name: EStructuralFeature getElementWildcardAffiliation(EClass, String, String)
|
Number of AST nodes: 5
|
|
Number of AST nodes: 6
|
|
1 | List<EStructuralFeature> allElements = getAllElements(eClass);↵ | | 1 | List<EStructuralFeature> allElements = getAllElements(eClass);↵
|
2 | for (int i = 0, size = allElements.size(); i < size; ++i)↵ | | 2 | for (int i = 0, size = allElements.size(); i < size; ++i)↵
|
3 | {↵ | | 3 | ↵
|
4 | ↵ | | 4 | {↵
|
5 | EStructuralFeature result = allElements.get(i);↵ | | 5 | EStructuralFeature result = allElements.get(i);↵
|
6 | if (matches(getWildcards(result), namespace))↵ | | 6 | if (matches(getWildcards(result), namespace))↵
|
7 | {↵ | | 7 | {↵
|
8 | return result;↵ | | 8 | return result;↵
|
9 | ↵ | | 9 | }↵
|
10 | }↵ | | 10 | }↵
|
|
11 | } | | 11 | return null;
|
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 10 |
-
{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 | 1 |
Time elapsed for statement mapping (ms) | 8.0 |
Clone type | Type 3 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
26 | List<EStructuralFeature> allElements = getAllElements(eClass); | | 1 | List<EStructuralFeature> allElements = getAllElements(eClass); |
27 | for (int i = 0, size = allElements.size(); i < size; ++i) | | 2 | for (int i = 0, size = allElements.size(); i < size; ++i) |
28 | EStructuralFeature result = allElements.get(i); | | 3 | EStructuralFeature result = allElements.get(i); |
29 | if (matches(getWildcards(result), namespace)) | | 4 | if (matches(getWildcards(result), namespace)) |
30 | | | 5 | |
| | | 6 | return null; |
Precondition Violations (1)
Row |
Violation |
1 | Unmatched return null; |