if (tree.getPathForLocation(e.getX(), e.getY()) != null) {
currentPath = tree.getPathForLocation(e.getX(), e.getY());
if (!contains(draggedNodes, getCurrentNode())) {
tree.setSelectionPath(currentPath);
}
}
if (tree.getPathForLocation(e.getX(), e.getY()) != null) {
currentPath = tree.getPathForLocation(e.getX(), e.getY());
if (!contains(draggedNodes, getCurrentNode())) {
tree.setSelectionPath(currentPath);
}
}
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/tree/JMeterTreeListener.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeListener.java
|
Method name: void changeSelectionIfDragging(MouseEvent)
|
|
Method name: void changeSelectionIfDragging(MouseEvent)
|
Number of AST nodes: 4
|
|
Number of AST nodes: 4
|
|
1 | if (tree.getPathForLocation(e.getX(), e.getY()) != null) {↵ | | 1 | if (tree.getPathForLocation(e.getX(), e.getY()) != null) {↵
|
2 | currentPath = tree.getPathForLocation(e.getX(), e.getY());↵ | | 2 | currentPath = tree.getPathForLocation(e.getX(), e.getY());↵
|
3 | if (!contains(draggedNodes, getCurrentNode())) {↵ | | 3 | if (!contains(draggedNodes, getCurrentNode())) {↵
|
4 | tree.setSelectionPath(currentPath);↵ | | 4 | tree.setSelectionPath(currentPath);↵
|
5 | }↵ | | 5 | }↵
|
6 | } | | 6 | }
|
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.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 9 |
-
{Refactorable}
Mapping Summary
Number of mapped statements | 4 |
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.6 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
3 | if (tree.getPathForLocation(e.getX(), e.getY()) != null) | | 3 | if (tree.getPathForLocation(e.getX(), e.getY()) != null) |
4 | currentPath = tree.getPathForLocation(e.getX(), e.getY()); | | 4 | currentPath = tree.getPathForLocation(e.getX(), e.getY()); |
5 | if (!contains(draggedNodes, getCurrentNode())) | | 5 | if (!contains(draggedNodes, getCurrentNode())) |
6 | tree.setSelectionPath(currentPath); | | 6 | tree.setSelectionPath(currentPath); |
Precondition Violations (0)
Row |
Violation |