Notifier newValue = (Notifier)notification.getNewValue(); if (newValue != null) { addAdapter(newValue); } break;
EObject oldValue = (EObject)notification.getOldValue(); if (oldValue != null) { inverseCrossReferencer.remove((EObject)notification.getNotifier(), (EReference)notification.getFeature(), oldValue); } break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/ECrossReferenceAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/util/ECrossReferenceAdapter.java
Method name: void handleContainment(Notification) Method name: void handleCrossReference(EReference, Notification)
Number of AST nodes: 4 Number of AST nodes: 4
1
Notifier newValue = (Notifier)notification.getNewValue();
1
EObject oldValue = (EObject)notification.getOldValue();
2
        if (newValue != null)
2
        if (oldValue != null)
3
        {
3
        {
4
          addAdapter(newValue);
4
          inverseCrossReferencer.remove((EObject)notification.getNotifier(), (EReference)notification.getFeature(), oldValue);
5
        }
5
        }
6
        break;
6
        break;
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 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 fragment1
    Time elapsed for statement mapping (ms)272.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    14
    Notifier newValue = (Notifier)notification.getNewValue();
                                                                                                                          
                                                                                                                      
    26
    EObject oldValue = (EObject)notification.getOldValue();
    15
    if (newValue != null)
    15
    if (newValue != null)
    27
    if (oldValue != null)
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    org.eclipse.emf.common.notify.Notifierorg.eclipse.emf.ecore.EObjectVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.eclipse.emf.common.notify.Notifier of variable newValue does not match with type org.eclipse.emf.ecore.EObject of variable oldValue
    • Make classes org.eclipse.emf.common.notify.Notifier and org.eclipse.emf.ecore.EObject extend a common superclass
    27
    if (oldValue != null)
    16
    addAdapter(newValue);
    16
    addAdapter(newValue);
    28
    inverseCrossReferencer.remove((EObject)notification.getNotifier(), (EReference)notification.getFeature(), oldValue);
    Differences
    Expression1Expression2Difference
    addAdapterremoveMETHOD_INVOCATION_NAME_MISMATCH
    addAdapter(newValue)inverseCrossReferencer.remove((EObject)notification.getNotifier(),(EReference)notification.getFeature(),oldValue)ARGUMENT_NUMBER_MISMATCH
    inverseCrossReferencerMISSING_METHOD_INVOCATION_EXPRESSION
    Preondition Violations
    Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    Expression inverseCrossReferencer.remove((EObject)notification.getNotifier(),(EReference)notification.getFeature(),oldValue) is a void method call, and thus it cannot be parameterized
    Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    Expression inverseCrossReferencer.remove((EObject)notification.getNotifier(),(EReference)notification.getFeature(),oldValue) is a void method call, and thus it cannot be parameterized
    28
    inverseCrossReferencer.remove((EObject)notification.getNotifier(), (EReference)notification.getFeature(), oldValue);
    17
    break;
    29
    break;
    Precondition Violations (5)
    Row Violation
    1Type org.eclipse.emf.common.notify.Notifier of variable newValue does not match with type org.eclipse.emf.ecore.EObject of variable oldValue
    2Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    3Expression inverseCrossReferencer.remove((EObject)notification.getNotifier(),(EReference)notification.getFeature(),oldValue) is a void method call, and thus it cannot be parameterized
    4Expression addAdapter(newValue) is a void method call, and thus it cannot be parameterized
    5Expression inverseCrossReferencer.remove((EObject)notification.getNotifier(),(EReference)notification.getFeature(),oldValue) is a void method call, and thus it cannot be parameterized