Point point = control.toControl(new Point(event.x, event.y)); Rectangle bounds = treeItem.getBounds(); return (float)(point.y - bounds.y) / (float)bounds.height;
Point point = control.toControl(new Point(event.x, event.y)); Rectangle bounds = tableItem.getBounds(0); 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: 3 Number of AST nodes: 3
1
Point point = control.toControl(new Point(event.x, event.y));
1
Point point = control.toControl(new Point(event.x, event.y));
2
      Rectangle bounds = treeItem.getBounds();
2
      Rectangle bounds = tableItem.getBounds(0);
3
      return (float)(point.y - bounds.y) / (float)bounds.height;
3
      return (float)(point.y - bounds.y) / (float)bounds.height;
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.0
Clones locationClones are in the same method
Number of node comparisons5
  1. {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.0
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    4
    Point point = control.toControl(new Point(event.x, event.y));
    10
    Point point = control.toControl(new Point(event.x, event.y));
    5
    Rectangle bounds = treeItem.getBounds();
    5
    Rectangle bounds = treeItem.getBounds();
    11
    Rectangle bounds = tableItem.getBounds(0);
    Differences
    Expression1Expression2Difference
    treeItemtableItemVARIABLE_NAME_MISMATCH
    org.eclipse.swt.widgets.TreeItemorg.eclipse.swt.widgets.TableItemSUBCLASS_TYPE_MISMATCH
    treeItem.getBounds()tableItem.getBounds(0)ARGUMENT_NUMBER_MISMATCH
    11
    Rectangle bounds = tableItem.getBounds(0);
    6
    return (float)(point.y - bounds.y) / (float)bounds.height;
    12
    return (float)(point.y - bounds.y) / (float)bounds.height;
    Precondition Violations (0)
    Row Violation