if (newValue == null) { viewer.refresh(object); } else { viewer.add(object, newValue); } break;
if (oldValue == null) { viewer.refresh(object); } else { viewer.remove(oldValue); } break;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/NotifyChangedToViewerRefresh.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/provider/NotifyChangedToViewerRefresh.java
Method name: void refreshAbstractTreeViewer(AbstractTreeViewer, Object, int, Object, Object, Object, int) Method name: void refreshAbstractTreeViewer(AbstractTreeViewer, Object, int, Object, Object, Object, int)
Number of AST nodes: 4 Number of AST nodes: 4
1
if (newValue == null)
1
if (oldValue == null)
2
        {
2
        {
3
          viewer.refresh(object);
3
          viewer.refresh(object);
4
        }
4
        }
5
        else
5
        else
6
        {
6
        {
7
          viewer.add(object, newValue);
7
          viewer.remove(oldValue);
8
        }
8
        }
9
        break;
9
        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 in the same method
Number of node comparisons11
  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.7
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    if (newValue == null)
    3
    if (newValue == null)
    11
    if (oldValue == null)
    Differences
    Expression1Expression2Difference
    newValueoldValueVARIABLE_NAME_MISMATCH
    11
    if (oldValue == null)
    4
    viewer.refresh(object);
    12
    viewer.refresh(object);
    else
    else
    5
    viewer.add(object, newValue);
    5
    viewer.add(object, newValue);
    13
    viewer.remove(oldValue);
    Differences
    Expression1Expression2Difference
    addremoveMETHOD_INVOCATION_NAME_MISMATCH
    viewer.add(object,newValue)viewer.remove(oldValue)ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression viewer.add(object,newValue) is a void method call, and thus it cannot be parameterized
    Expression viewer.remove(oldValue) is a void method call, and thus it cannot be parameterized
    Expression viewer.add(object,newValue) is a void method call, and thus it cannot be parameterized
    Expression viewer.remove(oldValue) is a void method call, and thus it cannot be parameterized
    13
    viewer.remove(oldValue);
    6
    break;
    14
    break;
    Precondition Violations (4)
    Row Violation
    1Expression viewer.add(object,newValue) is a void method call, and thus it cannot be parameterized
    2Expression viewer.remove(oldValue) is a void method call, and thus it cannot be parameterized
    3Expression viewer.add(object,newValue) is a void method call, and thus it cannot be parameterized
    4Expression viewer.remove(oldValue) is a void method call, and thus it cannot be parameterized