XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c); if (clsInfo != null) { String targetNamespace = clsInfo.getTargetNamespace(); nameInfo.setNamespaceURI(targetNamespace); nameInfo.setQualifiedName(getQName(targetNamespace, name)); return; }
XMLResource.XMLInfo info = xmlMap.getInfo(feature); if (info != null) { String targetNamespace = info.getTargetNamespace(); nameInfo.setNamespaceURI(targetNamespace); nameInfo.setQualifiedName(getQName(targetNamespace, name)); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/XMLHelperImpl.java
Method name: void populateNameInfo(NameInfo, EClass) Method name: void populateNameInfo(NameInfo, EStructuralFeature)
Number of AST nodes: 6 Number of AST nodes: 5
1
XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c);
1
XMLResource.XMLInfo info = xmlMap.getInfo(feature);
2
      if (clsInfo != null)
2
        if (info != null)
3
      {
3
        {
4
        String targetNamespace = clsInfo.getTargetNamespace();
4
          String targetNamespace = info.getTargetNamespace();
5
        nameInfo.setNamespaceURI(targetNamespace);
5
          nameInfo.setNamespaceURI(targetNamespace);
6
        nameInfo.setQualifiedName(getQName(targetNamespace, name));
6
          nameInfo.setQualifiedName(getQName(targetNamespace, name));
7
        return;
7
  
8
      }
8
      }
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 comparisons22
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)6.1
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    4
    XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c);
    4
    XMLResource.XMLInfo clsInfo = xmlMap.getInfo(c);
    18
    XMLResource.XMLInfo info = xmlMap.getInfo(feature);
    Differences
    Expression1Expression2Difference
    clsInfoinfoVARIABLE_NAME_MISMATCH
    cfeatureVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EClassorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EClass of variable c does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    • Make classes org.eclipse.emf.ecore.EClass and org.eclipse.emf.ecore.EStructuralFeature extend a common superclass
    18
    XMLResource.XMLInfo info = xmlMap.getInfo(feature);
    5
    if (clsInfo != null)
    5
    if (clsInfo != null)
    19
    if (info != null)
    Differences
    Expression1Expression2Difference
    clsInfoinfoVARIABLE_NAME_MISMATCH
    19
    if (info != null)
    6
    String targetNamespace = clsInfo.getTargetNamespace();
    6
    String targetNamespace = clsInfo.getTargetNamespace();
    20
    String targetNamespace = info.getTargetNamespace();
    Differences
    Expression1Expression2Difference
    clsInfoinfoVARIABLE_NAME_MISMATCH
    20
    String targetNamespace = info.getTargetNamespace();
    7
    nameInfo.setNamespaceURI(targetNamespace);
    21
    nameInfo.setNamespaceURI(targetNamespace);
    8
    nameInfo.setQualifiedName(getQName(targetNamespace, name));
    22
    nameInfo.setQualifiedName(getQName(targetNamespace, name));
    9
    return;
    9
    return;
    Preondition Violations
    Unmatched return;
                        
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EClass of variable c does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    2Unmatched return;