String label = eTypeParameter.getName(); if (label != null) { result.append(label); }
String name = info.getName(); if (name != null) { return info.getName(); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/impl/EGenericTypeImpl.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/xmi/impl/EMOFExtendedMetaData.java
Method name: void toString(StringBuilder) Method name: String getName(EClassifier)
Number of AST nodes: 3 Number of AST nodes: 3
1
String label = eTypeParameter.getName();
1
String name = info.getName();
2
      if (label != null)
2
      if (name != null)
3
      {
3
      {
4
        result.append(label);
4
        return info.getName();
5
      }
5
      }
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 in different classes
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    25
    String label = eTypeParameter.getName();
    25
    String label = eTypeParameter.getName();
    3
    String name = info.getName();
    Differences
    Expression1Expression2Difference
    labelnameVARIABLE_NAME_MISMATCH
    eTypeParameterinfoVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.ETypeParameterorg.eclipse.emf.ecore.xmi.XMLResource.XMLInfoVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.ETypeParameter of variable eTypeParameter does not match with type org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo of variable info
    • Make classes org.eclipse.emf.ecore.ETypeParameter and org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo extend a common superclass
    3
    String name = info.getName();
    26
    if (label != null)
    26
    if (label != null)
    4
    if (name != null)
    Differences
    Expression1Expression2Difference
    labelnameVARIABLE_NAME_MISMATCH
    4
    if (name != null)
                                                      
    5
    return info.getName();
    Preondition Violations
    Unmatched return info.getName();
    5
    return info.getName();
    27
    result.append(label);
                                                      
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.ETypeParameter of variable eTypeParameter does not match with type org.eclipse.emf.ecore.xmi.XMLResource.XMLInfo of variable info
    2Unmatched return info.getName();
    3Clone fragment #1 returns variables label , while Clone fragment #2 returns variables