boolean isValid = true;
TreeNode[] path = dest.getPath();
for (int i = 0; i < path.length; i++) {
if (contains(source, path[i])) {
isValid = false;
}
}
return isValid;
boolean isValid = true;
TreeNode[] path = dest.getPath();
for (int i = 0; i < path.length; i++) {
if (contains(source, path[i])) {
isValid = false;
}
}
return isValid;
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeListener.java
|
|
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/gui/tree/JMeterTreeListener.java
|
Method name: boolean isValidDragAction(ReportTreeNode[], ReportTreeNode)
|
|
Method name: boolean isValidDragAction(JMeterTreeNode[], JMeterTreeNode)
|
Number of AST nodes: 6
|
|
Number of AST nodes: 6
|
|
1 | boolean isValid = true;↵ | | 1 | boolean isValid = true;↵
|
2 | TreeNode[] path = dest.getPath();↵ | | 2 | TreeNode[] path = dest.getPath();↵
|
3 | for (int i = 0; i < path.length; i++) {↵ | | 3 | for (int i = 0; i < path.length; i++) {↵
|
4 | if (contains(source, path[i])) {↵ | | 4 | if (contains(source, path[i])) {↵
|
5 | isValid = false;↵ | | 5 | isValid = false;↵
|
6 | }↵ | | 6 | }↵
|
7 | }↵ | | 7 | }↵
|
8 | return isValid; | | 8 | return isValid;
|
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.3 |
Clones location | Clones are in different classes |
Number of node comparisons | 14 |
-
{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) | 0.8 |
Clone type | Type 1 |
Mapped Statements
ID |
Statement |
|
ID |
Statement |
1 | boolean isValid = true; | | 1 | boolean isValid = true; |
2 | TreeNode[] path = dest.getPath(); | | 2 | TreeNode[] path = dest.getPath(); |
3 | for (int i = 0; i < path.length; i++) | | 3 | for (int i = 0; i < path.length; i++) |
4 | if (contains(source, path[i])) | | 4 | if (contains(source, path[i])) |
5 | | | 5 | |
6 | return isValid; | | 6 | return isValid; |
Precondition Violations (0)
Row |
Violation |