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 hasManyInverse()
|
Method name: boolean isContainment()
|
|||
Number of AST nodes: 6 | 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 | EReference oppositeEReference = eReference.getEOpposite();↵ | 5 | ↵ | |
6 | return oppositeEReference != null && oppositeEReference.isMany();↵ | 6 | return eReference.isContainment();↵ | |
7 | }↵ | 7 | }↵ | |
8 | else↵ | 8 | else↵ | |
9 | {↵ | 9 | {↵ | |
10 | return false;↵ | 10 | return false;↵ | |
11 | } | 11 |
| |
See real code fragment | See real code fragment |
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 | 21 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 1 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 461.4 |
Clone type | Type 3 |
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; |
| | |||||||||||||||
4 | EReference oppositeEReference = eReference.getEOpposite(); |
| 3 | EReference eReference = (EReference)eStructuralFeature; | ||||||||||||||
5 | return oppositeEReference != null && oppositeEReference.isMany(); |
| 4 | return eReference.isContainment(); | ||||||||||||||
else | else | |||||||||||||||||
6 | return false; | 5 | return false; |
Row | Violation |
---|---|
1 | Unmatched statement EReference eReference=(EReference)eStructuralFeature; cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted |
2 | Expression (EReference)eStructuralFeature cannot be parameterized, because it has dependencies to/from statements that will be extracted |
3 | Expression oppositeEReference != null && oppositeEReference.isMany() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
4 | Expression eReference.isContainment() cannot be parameterized, because it has dependencies to/from statements that will be extracted |
5 | Clone fragment #1 returns variables eStructuralFeature , while Clone fragment #2 returns variables |