if (isValidValue(object, value, eStructuralFeature)) { return eStructuralFeature; }
if (isValidValue(object, child, eReference)) { return eReference; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemProviderAdapter.java
Method name: EStructuralFeature getSetFeature(Object, Object) Method name: EReference getChildReference(Object, Object)
Number of AST nodes: 2 Number of AST nodes: 2
1
if (isValidValue(object, value, eStructuralFeature))
1
if (isValidValue(object, child, eReference))
2
      {
2
      
3
  {
3
        return eStructuralFeature;
4
          return eReference;
4
      }
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.2
Clones locationClones are declared in the same class
Number of node comparisons5
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements1
    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
    2
    if (isValidValue(object, value, eStructuralFeature))
    2
    if (isValidValue(object, value, eStructuralFeature))
    3
    if (isValidValue(object, child, eReference))
    Differences
    Expression1Expression2Difference
    valuechildVARIABLE_NAME_MISMATCH
    eStructuralFeatureeReferenceVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EStructuralFeatureorg.eclipse.emf.ecore.EReferenceVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EReference of variable eReference
    • Make classes org.eclipse.emf.ecore.EStructuralFeature and org.eclipse.emf.ecore.EReference extend a common superclass
    3
    if (isValidValue(object, child, eReference))
    3
    return eStructuralFeature;
    3
    return eStructuralFeature;
    Preondition Violations
    Unmatched return eStructuralFeature;
                                                              
                                              
    4
    return eReference;
    Preondition Violations
    Unmatched return eReference;
    4
    return eReference;
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.EStructuralFeature of variable eStructuralFeature does not match with type org.eclipse.emf.ecore.EReference of variable eReference
    2Unmatched return eStructuralFeature;
    3Unmatched return eReference;