EStructuralFeature eStructuralFeature = getEStructuralFeature(); if (eStructuralFeature instanceof EReference) { EReference eReference = (EReference)eStructuralFeature; EReference oppositeEReference = eReference.getEOpposite(); return oppositeEReference != null && oppositeEReference.isMany(); } else { return false; }
EStructuralFeature eStructuralFeature = getEStructuralFeature(); if (eStructuralFeature instanceof EReference) { EReference eReference = (EReference)eStructuralFeature; return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null; } else { return false; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingEcoreEList.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/DelegatingEcoreEList.java
Method name: boolean hasManyInverse() Method name: boolean hasInverse()
Number of AST nodes: 6 Number of AST nodes: 5
1
EStructuralFeature eStructuralFeature = getEStructuralFeature();
1
EStructuralFeature eStructuralFeature = getEStructuralFeature();
2
    if (eStructuralFeature instanceof EReference)
2
    if (eStructuralFeature instanceof EReference)
3
    {
3
    {
4
      EReference eReference = (EReference)eStructuralFeature;
4
      EReference eReference = (EReference)eStructuralFeature;
5
      EReference oppositeEReference = eReference.getEOpposite();
5
      return eReference
6
      return oppositeEReference != null && oppositeEReference.isMany();
6
.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
7
    }
7
    }
8
    else
8
    else
9
    {
9
    {
10
      return false;
10
      return false;
11
    }
11
    }
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 comparisons21
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment2
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)0.6
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    1
    EStructuralFeature eStructuralFeature = getEStructuralFeature();
    1
    EStructuralFeature eStructuralFeature = getEStructuralFeature();
    2
    if (eStructuralFeature instanceof EReference)
    2
    if (eStructuralFeature instanceof EReference)
    3
    EReference eReference = (EReference)eStructuralFeature;
    3
    EReference eReference = (EReference)eStructuralFeature;
                                                                                                                                                                                                    
    4
    return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
    Preondition Violations
    Unmatched statement return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
    4
    return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
    4
    EReference oppositeEReference = eReference.getEOpposite();
                                                                                                                          
    5
    return oppositeEReference != null && oppositeEReference.isMany();
    5
    return oppositeEReference != null && oppositeEReference.isMany();
    Preondition Violations
    Unmatched return oppositeEReference != null && oppositeEReference.isMany();
                                                                                                                                            
    else
    else
    6
    return false;
    5
    return false;
    Precondition Violations (4)
    Row Violation
    1Unmatched statement return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null; cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    2Unmatched return eReference.isContainment() || ((EReference)eStructuralFeature).getEOpposite() != null;
    3Unmatched return oppositeEReference != null && oppositeEReference.isMany();
    4Clone fragment #1 returns variables eReference , while Clone fragment #2 returns variables eStructuralFeature, eReference