public ListedHashTree(Collection<?> keys) { this(); for (Object temp : keys) { data.put(temp, new ListedHashTree()); order.add(temp); } }
public ListedHashTree(Object[] keys) { this(); for (int x = 0; x < keys.length; x++) { Object temp = keys[x]; data.put(temp, new ListedHashTree()); order.add(tem
Clone fragments detected by clone detection tool
File path: /apache-jmeter-2.11/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java File path: /apache-jmeter-2.11/src/jorphan/org/apache/jorphan/collections/ListedHashTree.java
Method name: void ListedHashTree(Collection) Method name: void ListedHashTree(Object[])
Number of AST nodes: 3 Number of AST nodes: 4
1
public ListedHashTree(Collection<?> keys) {
1
public ListedHashTree(Object[] keys) {
2
        this();
2
        this();
3
        for (Object temp : keys) {
3
        for (int x = 0; x < keys.length; x++) {
4
            data.put(temp, new ListedHashTree());
4
            Object temp = keys[x];
5
            order.add(temp);
5
			data.put(temp, new ListedHashTree());
6
        }
6
            order.add(tem
7
    }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements4
    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.0
    Similarity Score0.750
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    2
    for (Object temp : keys)
    2
    for (Object temp : keys)
    2
    for (int x = 0; x < keys.length; x++)
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.lang.Object[]VARIABLE_TYPE_MISMATCH
    java.util.Collection<>java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    • Make classes java.util.Collection<> and java.lang.Object[] extend a common superclass
    Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    • Make classes java.util.Collection<> and java.lang.Object[] extend a common superclass
    2
    for (int x = 0; x < keys.length; x++)
                                                  
    3
    Object temp = keys[x];
    Differences
    Expression1Expression2Difference
    java.util.Collection<>java.lang.Object[]VARIABLE_TYPE_MISMATCH
    Preondition Violations
    Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    • Make classes java.util.Collection<> and java.lang.Object[] extend a common superclass
    3
    Object temp = keys[x];
    3
    data.put(temp, new ListedHashTree());
    4
    data.put(temp, new ListedHashTree());
    4
    order.add(temp);
    5
    order.add(temp);
    Precondition Violations (3)
    Row Violation
    1Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    2Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys
    3Type java.util.Collection<> of variable keys does not match with type java.lang.Object[] of variable keys