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
      }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in the same method
Number of node comparisons38
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)367.9
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    22
    helper.populateNameInfo(nameInfo, eClass);
    22
    helper.populateNameInfo(nameInfo, eClass);
    51
    helper.populateNameInfo(nameInfo, f);
    Differences
    Expression1Expression2Difference
    eClassfVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable f
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EStructuralFeature extend a common superclass
    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);
    else
    else
    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
    1Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable f