TableItem tableItem = (TableItem)event.item; Control control = tableItem.getParent(); Point point = control.toControl(new Point(event.x, event.y)); Rectangle bounds = tableItem.getBounds(0); return (float)(point.y - bounds.y) / (float)bounds.height;
TreeItem treeItem = (TreeItem)event.item; Control control = treeItem.getParent(); Point point = control.toControl(new Point(event.x, event.y)); Rectangle bounds = treeItem.getBounds(); return (float)(point.y - bounds.y) / (float)bounds.height;
Clone fragments detected by clone detection tool
File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/dnd/EditingDomainViewerDropAdapter.java File path: /emf-2.4.1/src/org/eclipse/emf/edit/ui/dnd/EditingDomainViewerDropAdapter.java
Method name: float getLocation(DropTargetEvent) Method name: float getLocation(DropTargetEvent)
Number of AST nodes: 5 Number of AST nodes: 5
1
TableItem tableItem = (TableItem)event.item;
1
TreeItem treeItem = (TreeItem)event.item;
2
      Control control = tableItem.getParent();
2
      Control control = treeItem.getParent();
3
      Point point = control.toControl(new Point(event.x, event.y));
3
      Point point = control.toControl(new Point(event.x, event.y));
4
      Rectangle bounds = tableItem.getBounds(0);
4
      Rectangle bounds = treeItem.getBounds();
5
      return (float)(point.y - bounds.y) / (float)bounds.height;
5
      return (float)(point.y - bounds.y) / (float)bounds.height;
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.0
Clones locationClones are in the same method
Number of node comparisons17
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements5
    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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    8
    TableItem tableItem = (TableItem)event.item;
    8
    TableItem tableItem = (TableItem)event.item;
    2
    TreeItem treeItem = (TreeItem)event.item;
    Differences
    Expression1Expression2Difference
    org.eclipse.swt.widgets.TableItemorg.eclipse.swt.widgets.TreeItemSUBCLASS_TYPE_MISMATCH
    tableItemtreeItemVARIABLE_NAME_MISMATCH
    org.eclipse.swt.widgets.TableItemorg.eclipse.swt.widgets.TreeItemSUBCLASS_TYPE_MISMATCH
    org.eclipse.swt.widgets.TableItemorg.eclipse.swt.widgets.TreeItemSUBCLASS_TYPE_MISMATCH
    2
    TreeItem treeItem = (TreeItem)event.item;
    9
    Control control = tableItem.getParent();
    9
    Control control = tableItem.getParent();
    3
    Control control = treeItem.getParent();
    Differences
    Expression1Expression2Difference
    tableItemtreeItemVARIABLE_NAME_MISMATCH
    org.eclipse.swt.widgets.TableItemorg.eclipse.swt.widgets.TreeItemSUBCLASS_TYPE_MISMATCH
    3
    Control control = treeItem.getParent();
    10
    Point point = control.toControl(new Point(event.x, event.y));
    4
    Point point = control.toControl(new Point(event.x, event.y));
    11
    Rectangle bounds = tableItem.getBounds(0);
    11
    Rectangle bounds = tableItem.getBounds(0);
    5
    Rectangle bounds = treeItem.getBounds();
    Differences
    Expression1Expression2Difference
    tableItemtreeItemVARIABLE_NAME_MISMATCH
    org.eclipse.swt.widgets.TableItemorg.eclipse.swt.widgets.TreeItemSUBCLASS_TYPE_MISMATCH
    tableItem.getBounds(0)treeItem.getBounds()ARGUMENT_NUMBER_MISMATCH
    Preondition Violations
    Expression tableItem.getBounds(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    Expression treeItem.getBounds() cannot be parameterized, because it has dependencies to/from statements that will be extracted
    5
    Rectangle bounds = treeItem.getBounds();
    12
    return (float)(point.y - bounds.y) / (float)bounds.height;
    6
    return (float)(point.y - bounds.y) / (float)bounds.height;
    Precondition Violations (2)
    Row Violation
    1Expression tableItem.getBounds(0) cannot be parameterized, because it has dependencies to/from statements that will be extracted
    2Expression treeItem.getBounds() cannot be parameterized, because it has dependencies to/from statements that will be extracted