EPackage ePackage = getPackage(namespace); if (ePackage != null) { EClass documentRoot = getDocumentRoot(ePackage); if (documentRoot != null) { return getLocalAttribute(documentRoot, namespace, name); } } return null;
EPackage ePackage = getPackage(namespace); if (ePackage != null) { EClass documentRoot = getDocumentRoot(ePackage); if (documentRoot != null) { return getLocalElement(documentRoot, namespace, name); } } return null;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/BasicExtendedMetaData.java
Method name: EStructuralFeature getAttribute(String, String) Method name: EStructuralFeature getElement(String, String)
Number of AST nodes: 6 Number of AST nodes: 6
1
EPackage ePackage = getPackage(namespace);
1
EPackage ePackage = getPackage(namespace);
2
    if (ePackage != null)
2
    if (ePackage != null)
3
    {
3
    {
4
      EClass documentRoot = getDocumentRoot(ePackage);
4
      EClass documentRoot = getDocumentRoot(ePackage);
5
      if (documentRoot != null)
5
      if (documentRoot != null)
6
      {
6
      {
7
        return getLocalAttribute(documentRoot, namespace, name);
7
        return getLocalElement(documentRoot, namespace, name);
8
      }
8
      }
9
    }
9
    }
10
    return null;
10
    return null;
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.2
Clones locationClones are declared in the same class
Number of node comparisons12
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements6
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.2
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    EPackage ePackage = getPackage(namespace);
    1
    EPackage ePackage = getPackage(namespace);
    2
    if (ePackage != null)
    2
    if (ePackage != null)
    3
    EClass documentRoot = getDocumentRoot(ePackage);
    3
    EClass documentRoot = getDocumentRoot(ePackage);
    4
    if (documentRoot != null)
    4
    if (documentRoot != null)
    5
    return getLocalAttribute(documentRoot, namespace, name);
    5
    return getLocalAttribute(documentRoot, namespace, name);
    5
    return getLocalElement(documentRoot, namespace, name);
    Differences
    Expression1Expression2Difference
    getLocalAttributegetLocalElementMETHOD_INVOCATION_NAME_MISMATCH
    Preondition Violations
    Expression getLocalAttribute(documentRoot,namespace,name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression getLocalElement(documentRoot,namespace,name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    return getLocalElement(documentRoot, namespace, name);
    6
    return null;
    6
    return null;
    Precondition Violations (2)
    Row Violation
    1Expression getLocalAttribute(documentRoot,namespace,name) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression getLocalElement(documentRoot,namespace,name) cannot be parameterized, because it has dependencies to/from statements that will be extracted