XMLResource.XMLInfo info = xmlMap.getInfo(feature); if (info != null) { String targetNamespace = info.getTargetNamespace(); nameInfo.setNamespaceURI(targetNamespace); nameInfo.setQualifiedName(getQName(targetNamespace, name)); }
XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType); if (clsInfo != null) { String targetNamespace = clsInfo.getTargetNamespace(); nameInfo.setNamespaceURI(targetNamespace); nameInfo.setQualifiedName(getQName(targetNamespace, name)); return; }
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, EStructuralFeature) Method name: void populateNameInfo(NameInfo, EDataType)
Number of AST nodes: 5 Number of AST nodes: 6
1
XMLResource.XMLInfo info = xmlMap.getInfo(feature);
1
XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType);
2
  
3
      if (info != null)
2
      if (clsInfo != null)
4
        {
3
      {
5
          String targetNamespace = info.getTargetNamespace();
4
        String targetNamespace = clsInfo.getTargetNamespace();
6
          nameInfo.setNamespaceURI(targetNamespace);
5
        nameInfo.setNamespaceURI(targetNamespace);
7
          nameInfo.setQualifiedName(getQName(targetNamespace, name));
6
        nameInfo.setQualifiedName(getQName(targetNamespace, name));
8
  
7
        return;
9
      }
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 fragment0
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)6.0
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    18
    XMLResource.XMLInfo info = xmlMap.getInfo(feature);
    18
    XMLResource.XMLInfo info = xmlMap.getInfo(feature);
    4
    XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType);
    Differences
    Expression1Expression2Difference
    infoclsInfoVARIABLE_NAME_MISMATCH
    featureeDataTypeVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EStructuralFeatureorg.eclipse.emf.ecore.EDataTypeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EStructuralFeature of variable feature does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    • Make classes org.eclipse.emf.ecore.EStructuralFeature and org.eclipse.emf.ecore.EDataType extend a common superclass
    4
    XMLResource.XMLInfo clsInfo = xmlMap.getInfo(eDataType);
    19
    if (info != null)
    19
    if (info != null)
    5
    if (clsInfo != null)
    Differences
    Expression1Expression2Difference
    infoclsInfoVARIABLE_NAME_MISMATCH
    5
    if (clsInfo != null)
    20
    String targetNamespace = info.getTargetNamespace();
    20
    String targetNamespace = info.getTargetNamespace();
    6
    String targetNamespace = clsInfo.getTargetNamespace();
    Differences
    Expression1Expression2Difference
    infoclsInfoVARIABLE_NAME_MISMATCH
    6
    String targetNamespace = clsInfo.getTargetNamespace();
    21
    nameInfo.setNamespaceURI(targetNamespace);
    7
    nameInfo.setNamespaceURI(targetNamespace);
    22
    nameInfo.setQualifiedName(getQName(targetNamespace, name));
    8
    nameInfo.setQualifiedName(getQName(targetNamespace, name));
                        
    9
    return;
    Preondition Violations
    Unmatched return;
    9
    return;
    Precondition Violations (2)
    Row Violation
    1Type org.eclipse.emf.ecore.EStructuralFeature of variable feature does not match with type org.eclipse.emf.ecore.EDataType of variable eDataType
    2Unmatched return;