helper.populateNameInfo(nameInfo, eClass);
if (currentNode == null)
{
currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
document.appendChild(currentNode);
handler.recordValues(currentNode, o.eContainer(), f, o);
}
else
{
currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()));
handler.recordValues(currentNode, o.eContainer(), f, o);
}
helper.populateNameInfo(nameInfo, f);
if (currentNode == null)
{
// this is a root element
currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
document.appendChild(currentNode);
handler.recordValues(currentNode, o.eContainer(), f, o);
}
else
{
currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()));
handler.recordValues(currentNode, o.eContainer(), f, o);
}
Clone fragments detected by clone detection tool
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: void saveElement(EObject, EStructuralFeature)
|
|
Method name: void saveElement(EObject, EStructuralFeature)
|
Number of AST nodes: 7
|
|
Number of AST nodes: 7
|
|
1 | helper.populateNameInfo(nameInfo, eClass);↵ | | 1 | helper.populateNameInfo(nameInfo, ↵
|
2 | ↵ | | 2 | f);↵
|
3 | if (currentNode == null)↵ | | 3 | if (currentNode == null)↵
|
4 | ↵ | | 4 | {↵
|
5 | {↵ | | 5 | ↵
|
6 | ↵ | | 6 | // this is a root element↵
|
7 | currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());↵ | | 7 | currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());↵
|
8 | document.appendChild(currentNode);↵ | | 8 | document.appendChild(currentNode);↵
|
9 | handler.recordValues(currentNode, o.eContainer(), f, o);↵ | | 9 | handler.recordValues(currentNode, o.eContainer(), f, o);↵
|
10 | }↵ | | 10 | ↵
|
11 | ↵ | | 11 | }↵
|
12 | else↵ | | 12 | else↵
|
13 | {↵ | | 13 | {↵
|
14 | currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()));↵ | | 14 | currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()));↵
|
15 | handler.recordValues(currentNode, o.eContainer(), f, o);↵ | | 15 | handler.recordValues(currentNode, o.eContainer(), f, o);↵
|
16 | } | | 16 | }
|
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.2 |
Clones location | Clones are in the same method |
Number of node comparisons | 38 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 7 |
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) | 367.9 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
22 | helper.populateNameInfo(nameInfo, eClass); | | 51 | helper.populateNameInfo(nameInfo, f); |
23 | if (currentNode == null) | | 52 | if (currentNode == null) |
24 | currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()); | | 53 | currentNode = document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()); |
25 | document.appendChild(currentNode); | | 54 | document.appendChild(currentNode); |
26 | handler.recordValues(currentNode, o.eContainer(), f, o); | | 55 | handler.recordValues(currentNode, o.eContainer(), f, o); |
| | | | |
27 | currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName())); | | 56 | currentNode = currentNode.appendChild(document.createElementNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName())); |
28 | handler.recordValues(currentNode, o.eContainer(), f, o); | | 57 | handler.recordValues(currentNode, o.eContainer(), f, o); |
Precondition Violations (1)
Row |
Violation |
1 | Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable f |