if (o instanceof AbstractTestElement) { return ((AbstractTestElement) o).propMap.equals(propMap); } else { return false; }
if (node instanceof TreeNode) { return ((TreeNode)node).isLeaf(); } else { return false; }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jmeter/testelement/AbstractTestElement.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/gui/AbstractTreeTableModel.java
Method name: boolean equals(Object) Method name: boolean isLeaf(Object)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (o instanceof AbstractTestElement) {
1
if (node instanceof 
2
			return ((AbstractTestElement) o).propMap.equals(propMap);
3
		} else {
4
			
2
TreeNode) {
3
            return ((TreeNode)node).isLeaf();
4
        } else {
5
return false;
5
            return false;
6
		}
6
        }
Summary
Number of common nesting structure subtrees1
Number of refactorable cases0
Number of non-refactorable cases1
Time elapsed for finding largest common nesting structure subtrees (ms)0.2
Clones locationClones are in different classes
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements2
    Number of unmapped statements in the first code fragment1
    Number of unmapped statements in the second code fragment1
    Time elapsed for statement mapping (ms)1.4
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (o instanceof AbstractTestElement)
    1
    if (o instanceof AbstractTestElement)
    1
    if (node instanceof TreeNode)
    Differences
    Expression1Expression2Difference
    onodeVARIABLE_NAME_MISMATCH
    org.apache.jmeter.testelement.AbstractTestElementjavax.swing.tree.TreeNodeVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type org.apache.jmeter.testelement.AbstractTestElement does not match with type javax.swing.tree.TreeNode
    • Make classes org.apache.jmeter.testelement.AbstractTestElement and javax.swing.tree.TreeNode extend a common superclass
    1
    if (node instanceof TreeNode)
                                                                            
    2
    return ((TreeNode)node).isLeaf();
    Preondition Violations
    Unmatched statement return ((TreeNode)node).isLeaf(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((TreeNode)node).isLeaf();
    2
    return ((TreeNode)node).isLeaf();
    2
    return ((AbstractTestElement)o).propMap.equals(propMap);
    2
    return ((AbstractTestElement)o).propMap.equals(propMap);
    Preondition Violations
    Unmatched statement return ((AbstractTestElement)o).propMap.equals(propMap); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    Unmatched return ((AbstractTestElement)o).propMap.equals(propMap);
                                                                                                                          
    else
    else
    3
    return false;
    3
    return false;
    Precondition Violations (6)
    Row Violation
    1Type org.apache.jmeter.testelement.AbstractTestElement does not match with type javax.swing.tree.TreeNode
    2Unmatched statement return ((TreeNode)node).isLeaf(); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    3Unmatched return ((TreeNode)node).isLeaf();
    4Unmatched statement return ((AbstractTestElement)o).propMap.equals(propMap); cannot be moved before the extracted code, because it has control dependencies from statements that will be extracted
    5Unmatched return ((AbstractTestElement)o).propMap.equals(propMap);
    6Not all possible execution flows end in a return statement