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;
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 1 |
Number of non-refactorable cases | 0 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.0 |
Clones location | Clones are in the same method |
Number of node comparisons | 5 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 3 |
Number of unmapped statements in the first code fragment | 0 |
Number of unmapped statements in the second code fragment | 0 |
Time elapsed for statement mapping (ms) | 0.0 |
Clone type | Type 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(); | | 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 |