int position = notification.getPosition(); for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;) { oldValue.remove(position); }
int position = notification.getPosition(); for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;) { oldValue.remove(position); }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/util/ChangeRecorder.java File path: /emf-2.4.1/src/org/eclipse/emf/ecore/change/util/ChangeRecorder.java
Method name: void handleFeature(EStructuralFeature, EReference, Notification, EObject) Method name: void handleResource(Notification)
Number of AST nodes: 3 Number of AST nodes: 3
1
int position = notification.getPosition();
1
int position = notification.getPosition();
2
          for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)
2
          for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0;)
3
          {
3
          {
4
            oldValue.remove(position);
4
            oldValue.remove(position);
5
          }
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.4
Clones locationClones are declared in the same class
Number of node comparisons6
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    39
    int position = notification.getPosition();
    33
    int position = notification.getPosition();
    40
    for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0; )
    34
    for (int i = ((Collection<?>)notification.getNewValue()).size(); --i >= 0; )
    41
    oldValue.remove(position);
    41
    oldValue.remove(position);
    35
    oldValue.remove(position);
    Differences
    Expression1Expression2Difference
    java.util.Listorg.eclipse.emf.common.util.EListVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.List<java.lang.Object> of variable oldValue does not match with type org.eclipse.emf.common.util.EList<java.lang.Object> of variable oldValue
    • Make classes java.util.List and org.eclipse.emf.common.util.EList extend a common superclass
    35
    oldValue.remove(position);
    Precondition Violations (1)
    Row Violation
    1Type java.util.List<java.lang.Object> of variable oldValue does not match with type org.eclipse.emf.common.util.EList<java.lang.Object> of variable oldValue