if (comparator == null) { return new SortedHashTree(key); } else { return new SortedHashTree(key, comparator); }
if (comparator == null) { return new SortedHashTree(values); } else { return new SortedHashTree(values, comparator); }
Clone fragments detected by clone detection tool
File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/SortedHashTree.java File path: /jakarta-jmeter-2.3.2/src/org/apache/jorphan/collections/SortedHashTree.java
Method name: HashTree createNewTree(Object) Method name: HashTree createNewTree(Collection)
Number of AST nodes: 3 Number of AST nodes: 3
1
if (comparator == null) {
1
if (comparator == null) {
2
			return new SortedHashTree(key);
2
			return new SortedHashTree(values);
3
		} else {
3
		} else {
4
			return new SortedHashTree(key, comparator);
4
			return new SortedHashTree(values, comparator);
5
		}
5
		}
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 declared in the same class
Number of node comparisons9
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    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.8
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    1
    if (comparator == null)
    1
    if (comparator == null)
    2
    return new SortedHashTree(key);
    2
    return new SortedHashTree(key);
    2
    return new SortedHashTree(values);
    Differences
    Expression1Expression2Difference
    keyvaluesVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.util.CollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable key does not match with type java.util.Collection of variable values
    • Make classes java.lang.Object and java.util.Collection extend a common superclass
    2
    return new SortedHashTree(values);
    else
    else
    3
    return new SortedHashTree(key, comparator);
    3
    return new SortedHashTree(key, comparator);
    3
    return new SortedHashTree(values, comparator);
    Differences
    Expression1Expression2Difference
    keyvaluesVARIABLE_NAME_MISMATCH
    java.lang.Objectjava.util.CollectionVARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.lang.Object of variable key does not match with type java.util.Collection of variable values
    • Make classes java.lang.Object and java.util.Collection extend a common superclass
    3
    return new SortedHashTree(values, comparator);
    Precondition Violations (2)
    Row Violation
    1Type java.lang.Object of variable key does not match with type java.util.Collection of variable values
    2Type java.lang.Object of variable key does not match with type java.util.Collection of variable values