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/gui/tree/JMeterTreeListener.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/report/gui/tree/ReportTreeListener.java
Method name: boolean isValidDragAction(JMeterTreeNode[], JMeterTreeNode) Method name: boolean isValidDragAction(ReportTreeNode[], ReportTreeNode)
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;
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.3
Clones locationClones are in different classes
Number of node comparisons14
  1. {Refactorable}
    Mapping Summary
    Number of mapped statements6
    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.7
    Clone typeType 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
    isValid = false;
    5
    isValid = false;
    6
    return isValid;
    6
    return isValid;
    Precondition Violations (0)
    Row Violation