EStructuralFeature eStructuralFeature = getEStructuralFeature();
if (eStructuralFeature instanceof EReference)
{
EReference eReference = (EReference)eStructuralFeature;
return eReference.isResolveProxies();
}
else
{
return false;
}
EStructuralFeature eStructuralFeature = getEStructuralFeature();
if (eStructuralFeature instanceof EReference)
{
EReference eReference = (EReference)eStructuralFeature;
return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
}
else
{
return false;
}
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingEcoreEList.java
|
|
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingEcoreEList.java
|
Method name: boolean hasProxies()
|
|
Method name: boolean hasInverse()
|
Number of AST nodes: 5
|
|
Number of AST nodes: 5
|
|
1 | EStructuralFeature eStructuralFeature = getEStructuralFeature();↵ | | 1 | EStructuralFeature eStructuralFeature = getEStructuralFeature();↵
|
2 | if (eStructuralFeature instanceof EReference)↵ | | 2 | if (eStructuralFeature instanceof EReference)↵
|
3 | {↵ | | 3 | {↵
|
4 | EReference eReference = (EReference)eStructuralFeature;↵ | | 4 | EReference eReference = (EReference)eStructuralFeature;↵
|
5 | return eReference.isResolveProxies();↵ | | 5 | return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;↵
|
6 | }↵ | | 6 | }↵
|
7 | else↵ | | 7 | else↵
|
8 | {↵ | | 8 | {↵
|
9 | return false;↵ | | 9 | return false;↵
|
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 declared in the same class |
Number of node comparisons | 17 |
-
{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 | 0 |
Time elapsed for statement mapping (ms) | 0.6 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | EStructuralFeature eStructuralFeature = getEStructuralFeature(); | | 1 | EStructuralFeature eStructuralFeature = getEStructuralFeature(); |
2 | if (eStructuralFeature instanceof EReference) | | 2 | if (eStructuralFeature instanceof EReference) |
3 | EReference eReference = (EReference)eStructuralFeature; | | 3 | EReference eReference = (EReference)eStructuralFeature; |
4 | return eReference.isResolveProxies(); | | 4 | return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null; |
| | | | |
5 | | | 5 | |
Precondition Violations (2)
Row |
Violation |
1 | Expression eReference.isResolveProxies() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
2 | Expression eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null cannot be parameterized, because it has dependencies to/from statements that will be extracted |