File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java | File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLSaveImpl.java | |||
Method name: boolean writeTopElements(EObject)
|
Method name: void writeTopAttributes(EObject)
|
|||
Number of AST nodes: 7 | Number of AST nodes: 6 | |||
1 | InternalEObject container = ((InternalEObject)top).eInternalContainer();↵ | 1 | InternalEObject container = ((InternalEObject)top).eInternalContainer();↵ | |
2 | if (container != null)↵ | 2 | if (container != null)↵ | |
3 | {↵ | 3 | {↵ | |
4 | EReference containmentReference = top.eContainmentFeature();↵ | 4 | EReference containmentReference = top.eContainmentFeature();↵ | |
5 | EReference containerReference = containmentReference.getEOpposite();↵ | 5 | EReference containerReference = containmentReference.getEOpposite();↵ | |
6 | if (containerReference != null && !containerReference.isTransient())↵ | 6 | if (containerReference != null && !containerReference.isTransient())↵ | |
7 | {↵ | 7 | {↵ | |
8 | saveHref(container, containerReference);↵ | 8 | saveEObjectSingle(top, containerReference);↵ | |
9 | return true;↵ | |||
10 | }↵ | 9 | }↵ | |
11 | } | 10 |
| |
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.3 |
Clones location | Clones are declared in the same class |
Number of node comparisons | 17 |
Number of mapped statements | 5 |
Number of unmapped statements in the first code fragment | 2 |
Number of unmapped statements in the second code fragment | 1 |
Time elapsed for statement mapping (ms) | 0.9 |
Clone type | Type 3 |
ID | Statement | ID | Statement | ||||
---|---|---|---|---|---|---|---|
2 | InternalEObject container = ((InternalEObject)top).eInternalContainer(); | 2 | InternalEObject container = ((InternalEObject)top).eInternalContainer(); | ||||
3 | if (container != null) | 3 | if (container != null) | ||||
4 | EReference containmentReference = top.eContainmentFeature(); | 4 | EReference containmentReference = top.eContainmentFeature(); | ||||
5 | EReference containerReference = containmentReference.getEOpposite(); | 5 | EReference containerReference = containmentReference.getEOpposite(); | ||||
6 | if (containerReference != null && !containerReference.isTransient()) | 6 | if (containerReference != null && !containerReference.isTransient()) | ||||
|
| 7 | saveEObjectSingle(top, containerReference); | ||||
7 | saveHref(container, containerReference); |
| | ||||
8 | return true; |
| |
Row | Violation |
---|---|
1 | Unmatched statement saveEObjectSingle(top,containerReference); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
2 | Unmatched statement saveHref(container,containerReference); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted |
3 | Unmatched return true; |
4 | Clone fragment #1 returns variables container, containerReference , while Clone fragment #2 returns variables containerReference |