helper.populateNameInfo(nameInfo, f); Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()); attr.setNodeValue(buffer.toString()); ((Element)currentNode).setAttributeNodeNS(attr); handler.recordValues(attr, o, f, value);
helper.populateNameInfo(nameInfo, f); Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName()); attr.setNodeValue(string); ((Element)currentNode).setAttributeNodeNS(attr); handler.recordValues(attr, o, f, values);
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 saveEObjectSingle(EObject, EStructuralFeature) Method name: void saveEObjectMany(EObject, EStructuralFeature)
Number of AST nodes: 5 Number of AST nodes: 5
1
helper.populateNameInfo(nameInfo, f);
1
helper.populateNameInfo(nameInfo, f);
2
          Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
2
          Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
3
          attr.setNodeValue(buffer.toString());      
3
          attr.setNodeValue(string);
4
          ((Element)currentNode).setAttributeNodeNS(attr);
4
          ((Element)currentNode).setAttributeNodeNS(attr);
5
          handler.recordValues(attr, o, f, value);
5
          handler.recordValues(attr, o, f, values);
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.0
Clones locationClones are declared in the same class
Number of node comparisons25
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    19
    helper.populateNameInfo(nameInfo, f);
    30
    helper.populateNameInfo(nameInfo, f);
    20
    Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
    31
    Attr attr = document.createAttributeNS(nameInfo.getNamespaceURI(), nameInfo.getQualifiedName());
    21
    attr.setNodeValue(buffer.toString());
    21
    attr.setNodeValue(buffer.toString());
    32
    attr.setNodeValue(string);
    Differences
    Expression1Expression2Difference
    buffer.toString()stringTYPE_COMPATIBLE_REPLACEMENT
    32
    attr.setNodeValue(string);
    22
    ((Element)currentNode).setAttributeNodeNS(attr);
    33
    ((Element)currentNode).setAttributeNodeNS(attr);
    23
    handler.recordValues(attr, o, f, value);
    23
    handler.recordValues(attr, o, f, value);
    34
    handler.recordValues(attr, o, f, values);
    Differences
    Expression1Expression2Difference
    valuevaluesVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EObjectorg.eclipse.emf.ecore.util.InternalEList<>VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EObject of variable value does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values
    • Make classes org.eclipse.emf.ecore.EObject and org.eclipse.emf.ecore.util.InternalEList<> extend a common superclass
    34
    handler.recordValues(attr, o, f, values);
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.EObject of variable value does not match with type org.eclipse.emf.ecore.util.InternalEList<> of variable values