if (!attributes.isEmpty())
{
if (result == null)
{
return attributes;
}
else
{
if (!changeable)
{
result = new UniqueEList<EStructuralFeature>(result);
}
result.addAll(attributes);
return result;
}
}
else
{
return result == null ? Collections.<EStructuralFeature>emptyList() : result;
}
if (!elements.isEmpty())
{
if (result == null)
{
return elements;
}
else
{
if (!changeable)
{
result = new UniqueEList<EStructuralFeature>(result);
}
result.addAll(elements);
return result;
}
}
else
{
return result == null ? Collections.<EStructuralFeature>emptyList() : result;
}
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: List getAllAttributes(EClass)
|
|
Method name: List getAllElements(EClass)
|
Number of AST nodes: 8
|
|
Number of AST nodes: 8
|
|
1 | if (!attributes.isEmpty())↵ | | 1 | if (!elements.isEmpty())↵
|
2 | {↵ | | 2 | {↵
|
3 | if (result == null)↵ | | 3 | if (result == null)↵
|
4 | {↵ | | 4 | {↵
|
5 | return attributes;↵ | | 5 | return elements;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | if (!changeable)↵ | | 9 | if (!changeable)↵
|
10 | {↵ | | 10 | {↵
|
11 | result = new UniqueEList<EStructuralFeature>(result);↵ | | 11 | result = new UniqueEList<EStructuralFeature>(result);↵
|
12 | }↵ | | 12 | }↵
|
13 | result.addAll(attributes);↵ | | 13 | result.addAll(elements);↵
|
14 | return result;↵ | | 14 | return result;↵
|
15 | }↵ | | 15 | }↵
|
16 | }↵ | | 16 | }↵
|
17 | else↵ | | 17 | else↵
|
18 | {↵ | | 18 | {↵
|
19 | return result == null ? Collections.<EStructuralFeature>emptyList() : result;↵ | | 19 | return result == null ? Collections.<EStructuralFeature>emptyList() : result;↵
|
20 | } | | 20 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
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 | 25 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 8 |
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) | 1.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
15 | if (!attributes.isEmpty()) | | 15 | if (!elements.isEmpty()) |
16 | | | 16 | |
17 | | | 17 | |
| | | | |
18 | | | 18 | |
19 | result = new UniqueEList<EStructuralFeature>(result); | | 19 | result = new UniqueEList<EStructuralFeature>(result); |
20 | result.addAll(attributes); | | 20 | |
21 | | | 21 | |
| | | | |
22 | return result == null ? Collections.<EStructuralFeature>emptyList() : result; | | 22 | return result == null ? Collections.<EStructuralFeature>emptyList() : result; |
Precondition Violations (0)
Row |
Violation |