EClass documentRoot = getDocumentRoot(ePackage); if (documentRoot != null) { return getLocalElement(documentRoot, namespace, name); }
EClass oppositeEClass = opposite.getEContainingClass(); if (oppositeEClass != null) { oppositeEClass.getEStructuralFeatures().remove(opposite); }
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/importer/rose/builder/RoseEcoreBuilder.java
Method name: EStructuralFeature getElement(String, String) Method name: Object validateEClass(EClass)
Number of AST nodes: 3 Number of AST nodes: 3
1
EClass documentRoot = getDocumentRoot(ePackage);
1
EClass 
2
      if (documentRoot != null)
3
      {
4
        return getLocalElement(documentRoot, namespace, nam
2
oppositeEClass = opposite.getEContainingClass();
3
      if (oppositeEClass != null)
4
      {
5
e);
5
        oppositeEClass.getEStructuralFeatures().remove(opposite);
6
      }
6
      }
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)30.6
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    EClass documentRoot = getDocumentRoot(ePackage);
    3
    EClass documentRoot = getDocumentRoot(ePackage);
    51
    EClass oppositeEClass = opposite.getEContainingClass();
    Differences
    Expression1Expression2Difference
    documentRootoppositeEClassVARIABLE_NAME_MISMATCH
    getDocumentRootgetEContainingClassMETHOD_INVOCATION_NAME_MISMATCH
    getDocumentRoot(ePackage)opposite.getEContainingClass()ARGUMENT_NUMBER_MISMATCH
    oppositeMISSING_METHOD_INVOCATION_EXPRESSION
    51
    EClass oppositeEClass = opposite.getEContainingClass();
    4
    if (documentRoot != null)
    4
    if (documentRoot != null)
    52
    if (oppositeEClass != null)
    Differences
    Expression1Expression2Difference
    documentRootoppositeEClassVARIABLE_NAME_MISMATCH
    52
    if (oppositeEClass != null)
    5
    return getLocalElement(documentRoot, namespace, name);
                                                                                                                  
                                                                                                                              
    53
    oppositeEClass.getEStructuralFeatures().remove(opposite);
    Preondition Violations
    Unmatched statement oppositeEClass.getEStructuralFeatures().remove(opposite); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted
    53
    oppositeEClass.getEStructuralFeatures().remove(opposite);
    Precondition Violations (1)
    Row Violation
    1Unmatched statement oppositeEClass.getEStructuralFeatures().remove(opposite); cannot be moved before or after the extracted code, because it has dependencies to/from statements that will be extracted