if (child instanceof EObject) { EObject eObject = (EObject)child; if (eObject.eContainer() == eGenericType) { // If it's really a contained child, return the feature for it. // return eObject.eContainingFeature(); } }
if (child instanceof EObject) { EObject eObject = (EObject)child; if (eObject.eContainer() == eOperation) { // If it's really a contained child, return the feature for it. // return eObject.eContainingFeature(); } }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EGenericTypeItemProvider.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/provider/EOperationItemProvider.java
Method name: EStructuralFeature getChildFeature(Object, Object) Method name: EStructuralFeature getChildFeature(Object, Object)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (child instanceof EObject)
1
if (child instanceof EObject)
2
    {
2
    {
3
      EObject eObject = (EObject)child;
3
      EObject eObject = (EObject)child;
4
      if (eObject.eContainer() == eGenericType)
4
      if (eObject.eContainer() == eOperation)
5
      {
5
      {
6
        // If it's really a contained child, return the feature for it.
6
        // If it's really a contained child, return the feature for it.
7
        //
7
        //
8
        return eObject.eContainingFeature();
8
        return eObject.eContainingFeature();
9
      }
9
      }
10
    }
10
    }
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 in different classes having the same super class
Number of node comparisons8
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.5
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    if (child instanceof EObject)
    2
    if (child instanceof EObject)
    3
    EObject eObject = (EObject)child;
    3
    EObject eObject = (EObject)child;
    4
    if (eObject.eContainer() == eGenericType)
    4
    if (eObject.eContainer() == eGenericType)
    4
    if (eObject.eContainer() == eOperation)
    Differences
    Expression1Expression2Difference
    eGenericTypeeOperationVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EGenericTypeorg.eclipse.emf.ecore.EOperationVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EGenericType of variable eGenericType does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation
    • Make classes org.eclipse.emf.ecore.EGenericType and org.eclipse.emf.ecore.EOperation extend a common superclass
    4
    if (eObject.eContainer() == eOperation)
    5
    return eObject.eContainingFeature();
    5
    return eObject.eContainingFeature();
    Precondition Violations (1)
    Row Violation
    1Type org.eclipse.emf.ecore.EGenericType of variable eGenericType does not match with type org.eclipse.emf.ecore.EOperation of variable eOperation