if (tableItem != selectedTableItem) { table.setSelection(i); Event selectionEvent = new Event(); selectionEvent.widget = table; selectionEvent.item = tableItem; table.notifyListeners(SWT.Selection, selectionEvent); selectedTableItem = tableItem; }
if (tableItem != selectedTableItem) { table.setSelection(i); Event selectionEvent = new Event(); selectionEvent.widget = table; selectionEvent.item = tableItem; table.notifyListeners(SWT.Selection, selectionEvent); selectedTableItem = tableItem; }
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/celleditor/ExtendedTableEditor.java File path: /emf-2.4.1/src/org/eclipse/emf/common/ui/celleditor/ExtendedTableTreeEditor.java
Method name: void mouseDown(MouseEvent) Method name: void mouseDown(MouseEvent)
Number of AST nodes: 7 Number of AST nodes: 7
1
if (tableItem != selectedTableItem)
1
if (tableItem != selectedTableItem)
2
                {
2
                {
3
                  table.setSelection(i);
3
                  table.setSelection(i);
4
                  Event selectionEvent = new Event();
4
                  Event selectionEvent = new Event();
5
                  selectionEvent.widget = table;
5
                  selectionEvent.widget = table;
6
                  selectionEvent.item = tableItem;
6
                  selectionEvent.item = tableItem;
7
                  table.notifyListeners(SWT.Selection, selectionEvent);
7
                  table.notifyListeners(SWT.Selection, selectionEvent);
8
                  selectedTableItem = tableItem;
8
                  selectedTableItem = tableItem;
9
                }
9
                }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases1
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes having the same super class
Number of node comparisons52
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements7
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)2.3
    Clone typeType 1
    Mapped Statements
    ID Statement ID Statement
    17
    if (tableItem != selectedTableItem)
    17
    if (tableItem != selectedTableItem)
    18
    table.setSelection(i);
    18
    table.setSelection(i);
    19
    Event selectionEvent = new Event();
    19
    Event selectionEvent = new Event();
    20
    selectionEvent.widget = table;
    20
    selectionEvent.widget = table;
    21
    selectionEvent.item = tableItem;
    21
    selectionEvent.item = tableItem;
    22
    table.notifyListeners(SWT.Selection, selectionEvent);
    22
    table.notifyListeners(SWT.Selection, selectionEvent);
    23
    selectedTableItem = tableItem;
    23
    selectedTableItem = tableItem;
    Precondition Violations (0)
    Row Violation