declareXSI = true; if (!toDOM) { doc.addAttribute(XSI_TYPE_NS, helper.getQName(eClass)); } else { helper.populateNameInfo(nameInfo, eClass); ((Element)currentNode).setAttributeNS(ExtendedMetaData.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName()); }
declareXSI = true; if (!toDOM) { doc.addAttribute(XSI_TYPE_NS, helper.getQName(eDataType)); } else { helper.populateNameInfo(nameInfo, eDataType); ((Element)currentNode).setAttributeNS(XMLResource.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName()); }
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 saveTypeAttribute(EClass) Method name: void saveTypeAttribute(EDataType)
Number of AST nodes: 5 Number of AST nodes: 5
1
declareXSI = true;
1
declareXSI = true;
2
    if (!toDOM)
2
    if (!toDOM)
3
    {
3
    {
4
      doc.addAttribute(XSI_TYPE_NS, helper.getQName(eClass));
4
      doc.addAttribute(XSI_TYPE_NS, helper.getQName(eDataType));
5
    }
5
    }
6
    else
6
    else
7
    {
7
    {
8
      helper.populateNameInfo(nameInfo, eClass);
8
      helper.populateNameInfo(nameInfo, eDataType);
9
      ((Element)currentNode).setAttributeNS(ExtendedMetaData.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
9
      ((Element)currentNode).setAttributeNS(XMLResource.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
10
    }
10
    }
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.1
Clones locationClones are declared in the same class
Number of node comparisons17
  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)1.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    declareXSI = true;
    1
    declareXSI = true;
    2
    if (!toDOM)
    2
    if (!toDOM)
    3
    doc.addAttribute(XSI_TYPE_NS, helper.getQName(eClass));
    3
    doc.addAttribute(XSI_TYPE_NS, helper.getQName(eClass));
    3
    doc.addAttribute(XSI_TYPE_NS, helper.getQName(eDataType));
    Differences
    Expression1Expression2Difference
    eClasseDataTypeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EDataType extend a common superclass
    3
    doc.addAttribute(XSI_TYPE_NS, helper.getQName(eDataType));
    else
    else
    4
    helper.populateNameInfo(nameInfo, eClass);
    4
    helper.populateNameInfo(nameInfo, eClass);
    4
    helper.populateNameInfo(nameInfo, eDataType);
    Differences
    Expression1Expression2Difference
    eClasseDataTypeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EDataType extend a common superclass
    4
    helper.populateNameInfo(nameInfo, eDataType);
    5
    ((Element)currentNode).setAttributeNS(ExtendedMetaData.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
    5
    ((Element)currentNode).setAttributeNS(ExtendedMetaData.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
    5
    ((Element)currentNode).setAttributeNS(XMLResource.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
    Differences
    Expression1Expression2Difference
    org.eclipse.emf.ecore.util.ExtendedMetaDataorg.eclipse.emf.ecore.xmi.XMLResourceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.util.ExtendedMetaData of variable ExtendedMetaData does not match with type org.eclipse.emf.ecore.xmi.XMLResource of variable XMLResource
    • Make classes org.eclipse.emf.ecore.util.ExtendedMetaData and org.eclipse.emf.ecore.xmi.XMLResource extend a common superclass
    5
    ((Element)currentNode).setAttributeNS(XMLResource.XSI_URI, XSI_TYPE_NS, nameInfo.getQualifiedName());
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    2Type org.eclipse.emf.ecore.EClass of variable eClass does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    3Type org.eclipse.emf.ecore.util.ExtendedMetaData of variable ExtendedMetaData does not match with type org.eclipse.emf.ecore.xmi.XMLResource of variable XMLResource