if (dragging) {
GuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY());
if (tree.getPathForLocation(e.getX(), e.getY()) != null) {
currentPath = tree.getPathForLocation(e.getX(), e.getY());
if (!contains(draggedNodes, getCurrentNode())) {
tree.setSelectionPath(currentPath);
}
}
}
if (dragging) {
ReportGuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY());
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: 6
|
|
Number of AST nodes: 6
|
|
1 | if (dragging) {↵ | | 1 | if (dragging) {↵
|
2 | GuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY());↵ | | 2 | ReportGuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY());↵
|
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);↵
|
7 | }↵ | | 7 | }↵
|
8 | }↵ | | 8 | }↵
|
9 | } | | 9 | }
|
See real code fragment |
|
See real code fragment |
Summary
Number of common nesting structure subtrees | 1 |
Number of refactorable cases | 0 |
Number of non-refactorable cases | 1 |
Time elapsed for finding largest common nesting structure subtrees (ms) | 0.4 |
Clones location | Clones are in different classes |
Number of node comparisons | 12 |
-
{Non-refactorable}
Mapping Summary
Number of mapped statements | 6 |
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) | 1.1 |
Clone type | Type 2 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | if (dragging) | | 1 | if (dragging) |
2 | GuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY()); | | 2 | ReportGuiPackage.getInstance().getMainFrame().drawDraggedComponent(dragIcon, e.getX(), e.getY()); |
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 (2)
Row |
Violation |
1 | Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage.getInstance() does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage.getInstance() |
2 | Type org.apache.jmeter.gui.GuiPackage of variable GuiPackage does not match with type org.apache.jmeter.gui.ReportGuiPackage of variable ReportGuiPackage |