FeatureMap featureMap = (FeatureMap)value;
for (int j = 0, size = featureMap.size(); j < size; ++j)
{
if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null)
{
++result;
}
}
FeatureMap featureMap = (FeatureMap)value;
for (int j = 0, size = featureMap.size(); j < size; ++j)
{
if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null)
{
return false;
}
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/EContentsEList.java
|
Method name: int size()
|
|
Method name: boolean isEmpty()
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | FeatureMap featureMap = (FeatureMap)value;↵ | | 1 | FeatureMap featureMap = (FeatureMap)value;↵
|
2 | for (int j = 0, size = featureMap.size(); j < size; ++j)↵ | | 2 | for (int j = 0, size = featureMap.size(); j < size; ++j)↵
|
3 | {↵ | | 3 | {↵
|
4 | if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null)↵ | | 4 | if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null)↵
|
5 | {↵ | | 5 | {↵
|
6 | ++result;↵ | | 6 | return false;↵
|
7 | }↵ | | 7 | }↵
|
8 | } | | 8 | }
|
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.6 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 9 |
-
{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.7 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
8 | FeatureMap featureMap = (FeatureMap)value; | | 7 | FeatureMap featureMap = (FeatureMap)value; |
9 | for (int j = 0, size = featureMap.size(); j < size; ++j) | | 8 | for (int j = 0, size = featureMap.size(); j < size; ++j) |
10 | if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null) | | 9 | if (isIncludedEntry(featureMap.getEStructuralFeature(j)) && featureMap.getValue(j) != null) |
| | | 10 | |
11 | | | | |
Precondition Violations (2)
Row |
Violation |
1 | Unmatched return false; |
2 | Unmatched statement ++result; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |