if (editingDomain == null) { eObject.eSet(parentReference, value); } else { editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), parentReference, value)); } return;
if (editingDomain == null) { eObject.eSet(feature, value); } else { editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), feature, value)); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemPropertyDescriptor.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/provider/ItemPropertyDescriptor.java
Method name: void setPropertyValue(Object, Object) Method name: void setPropertyValue(Object, Object)
Number of AST nodes: 4 Number of AST nodes: 3
1
if (editingDomain == null)
1
if (editingDomain == null)
2
            {
2
      
3
      
3
{
4
        eObject.eSet(parentReference, value);
4
        eObject.eSet(feature, value);
5
            }
5
      
6
  
6
}
7
          else
7
      else
8
            {
8
      {
9
              editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), parentReference, value));
9
        editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), feature, value));
10
            }
10
      }
11
            return;
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 the same method
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 3
    Mapped Statements
    ID Statement ID Statement
    12
    if (editingDomain == null)
    32
    if (editingDomain == null)
    13
    eObject.eSet(parentReference, value);
    13
    eObject.eSet(parentReference, value);
    33
    eObject.eSet(feature, value);
    Differences
    Expression1Expression2Difference
    parentReferencefeatureVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable parentReference does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EStructuralFeature extend a common superclass
    33
    eObject.eSet(feature, value);
    else
    else
    14
    editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), parentReference, value));
    14
    editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), parentReference, value));
    34
    editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), feature, value));
    Differences
    Expression1Expression2Difference
    parentReferencefeatureVARIABLE_NAME_MISMATCH
    org.eclipse.emf.ecore.EReferenceorg.eclipse.emf.ecore.EStructuralFeatureVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.ecore.EReference of variable parentReference does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    • Make classes org.eclipse.emf.ecore.EReference and org.eclipse.emf.ecore.EStructuralFeature extend a common superclass
    34
    editingDomain.getCommandStack().execute(SetCommand.create(editingDomain, getCommandOwner(eObject), feature, value));
    15
    return;
    15
    return;
    Preondition Violations
    Unmatched return;
                          
    Precondition Violations (3)
    Row Violation
    1Type org.eclipse.emf.ecore.EReference of variable parentReference does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    2Type org.eclipse.emf.ecore.EReference of variable parentReference does not match with type org.eclipse.emf.ecore.EStructuralFeature of variable feature
    3Unmatched return;